wrap li elements in a loop
i have this piece of code that I am trying to scroll using the jQuery scroller plugin.
<ul>
<li style="margin-left:2px;"><span><?php echo a ?></span></li>
<li style="margin-left:2px;"><span><?php echo b ?></span></li>
<li style="margin-left:2px;"><span><?php echo $arrow?></span></li>
<li style="margin-left:2px;"><span><?php echo c ?></span></li>
<li style="margin-l开发者_如何学编程eft:2px;"><span><?php echo d ?> </span></li>
</ul>
I am trying to get the li elements in the sequence..
a b c d a1 b1 c1 d1 a2 b2 c2 d2
... so on...where
a1 - stands for ajax refreshed a.
any ideas on how to implement this?
TRY
var listValue = jQuery('ul').children().map( function() {
return jQuery(this).text();
}).get();
alert(listValue);
精彩评论