我试图在jQuery中 Select 所有具有相同ID的<div>
个.我该怎么做?
I tried this and it did not work
jQuery('#xx').each(function(ind,obj){
//do stuff;
});
我试图在jQuery中 Select 所有具有相同ID的<div>
个.我该怎么做?
I tried this and it did not work
jQuery('#xx').each(function(ind,obj){
//do stuff;
});
我会使用不同的ID,但会给每个DIV分配相同的类.
<div id="c-1" class="countdown"></div>
<div id="c-2" class="countdown"></div>
这还有一个额外的好处,即能够基于jQuery的返回(".countdown")重构ID.长
Ok what about adding multiple classes to each countdown timer. IE:
<div class="countdown c-1"></div>
<div class="countdown c-2"></div>
<div class="countdown c-1"></div>
That way you get the best of both worlds. It even allows repeat 'IDS'