Is it possible to change css class using jQuery? For example, if I defined this class:
.my-class{ right:10px; }
and now I want to change it to
.my-class{ right:20px; }
without having to select all the elements of this class using $ (". myClass"). The reason I want to do this is because I add a lot of elements at runtime in js, and it would be nice to change the class definition ahead of time.
.myClass is defined in the css file, otherwise I would suggest that I could change its definition with jsf / jstl if it were on the page.
source share