Just getting used to jQuery.
I want to select all the objects in the DOM that have a class named bcblue on my web page.
I then want to loop through each element and modify them.
How can I select these items?
blah blah blah is here! blah blah » Close
1 answers
You can select all elements with a particular class name using the jquery selector:
$().ready( function() {
$(".bcblue").each(function(i) {
// do what you want here
});
});
You can read more on looping: http://docs.jquery.com/Core/each
And jQuery selectors by class: http://docs.jquery.com/Selectors/class#class
answered 2 years ago by:
510