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()); }); 

jquery :first-child in .each() loop - jsfiddle


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -