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
Post a Comment