javascript - Selecting inside of DIVs -


let's have list this:

<ul class="list"> <li><span class="pos"><div class="txt_pos">1</div></li> <li><span class="pos"><div class="txt_pos">2</div></li> <li><span class="pos"><div class="txt_pos">3</div></li> <li><span class="pos"><div class="txt_pos">4</div></li> <li><span class="pos"><div class="txt_pos">5</div></li> </ul> 

and js:

$(".list span.pos").each(function(i) {     var newone = i;     newrank = getnth(newone);      $("> .txt_pos").slidetoggle('slow');     $(this).text(newrank);         $("> .txt_pos").slidetoggle('slow');                         }); 

how make select each li because right now, it's doing every list item @ once. i'm trying select child of .pos.

$(".list span.pos").each(function(i) {         var newone = i;         newrank = getnth(newone);          $(this).children('.txt_pos').slidetoggle('slow');         $(this).text(newrank);             $(this).children('.txt_pos').slidetoggle('slow');  //not sure why you're doing again? )}; 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -