<ul>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
<script>
$(document).ready(function(){
var increment=3;
var start=8;
$("ul").children().each(function(i) {
$(this).prepend( <tag> +(start+i*increment).toString()+ .</tag> );
});
});
</script>
Is there a way to start a new count for another ul list? With the code above this is what i get!
<ul>
<li> test
<li> test
<li> test
<ul/>
产出
1. test
2. test
3. test
第二编名单
<ul>
<li> test
<li> test
<li> test
<ul/>
产出:
4. test
5. test
6. test
而不是从第二个tag头开始1。 2. 仍在使用第一部第5条。 6. 结 论
So is it possible to reset the count and star it all over again for another ul tag? If it is possible how?