blah blah blah is here! blah blah » Close

up2down
link

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?

what exactly do you want to modify in your loop?

last answered 2 years ago

1 answers

up2down
link

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

Feedback