1

Is there a way to use jQuery to set values inside a class? So for example if I have a class like this:

.menubar {
background: #333;
color: #fff;
}

Can I then run something like:

$('.menubar').css('background', '#999');

... to set the value of that class to #999? And I don't mean to select all the elements with the class and set their background, I mean can I change the actual classes value to #999 so that if an element is created later with the class it will have #999 instead of #333.

Simon Hyll
  • 3,265
  • 3
  • 24
  • 44

0 Answers0