Defining a class with specific style dynamically in jQuery
- by Acorn
Is it possible to define a class with specific style attributes dynamically with jQuery, rather than setting the style of all elements with that class?
I could set the attributes of the class at the end of the script once all the elements have been created, but is that the best way to go about it? If I define the style of the class with $('.class').css('property','value'); at the beginning of the script, nothing would happen because the elements with class .class haven't been created yet, right?