开发者

Loop through elements with a given classname

Using jquery, how can I iterate through all elements in a given class?开发者_开发技巧


Using the each method.

$('.klass').each( function() {
    $(this)... // will be an instance of the element matching the class selector
});


When in doubt, look at the documentation: http://api.jquery.com/each/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜