Is there a way to change the properties of a CSS class, not the element properties, using jQuery?
This is a practical example:
I have a div with class red
.red {background: red;}
I want to change class red background property, not elements that have class red background assigned.
If I do it with jQuery .css() method:
$('.red').css('background','green');
it will affect the elements that right now have class red. Up to here everything is fine.
But if I make an Ajax call, and insert more divs with red class, those won't have a green background, they will have the initial red background.
I could call jQuery .css() method again. But I would like to know if there is a way to change the class itself. Please consider this is just a basic example.
<style>element. See CSSStyleSheet.deleteRule and CSSStyleSheet.insertRule