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/
精彩评论