Reputation: 2193
I have a label in a div .
<div id="mydiv">
<label>text</label>
</div>
how to write a selector to access the label and change the text .
Upvotes: 2
Views: 5230
Reputation: 82241
Use:
$('#mydiv label').text('smtext');
Update: to change second label element in mydiv:
$('#mydiv label:eq(1)').text('smtext');
Upvotes: 8