jquery - use first-Child with $(this) -
$(this):first-child
wrong syntax
i didn't know how use first-child
$(this)
in .each
loop.
you can .find()
.
html
<div id='mydiv'> <p>hello</p> <p>world</p> </div>
javascript
$('#mydiv').each(function() { alert($(this).find(':first-child').text()); });
Comments
Post a Comment