javascript - How can I change a label text without interfering with an input radio inside the label? -
in html template i've got label input radio inside:
<label id="myid" class="inline"> <input type="radio" value ="11"> text </label>
i need change text of label jquery. tried this:
$('#myid').html('my new text');
or
$('#myid').text('my new text');
but when loose input radio. how can preserve input radio inside label , modify label's text?
try this:
$('#myid').contents().last().replacewith('my new text');
Comments
Post a Comment