JQuery Method for adding style attributes (recommended) and jquery Style
Add multiple attributes to the jQuery class
$ ('# Five .a'hangzhou.css ({color: 'blue', border: '2px solid green', background: 'blue '});
JQuer adds classes for elements
$ ('# Five. A'). addClass ('funny ');
HTML code
<Style>. funny {font-size: 21px; background-color: gray; padding: 10px; color: yellow ;} </style> <div id = "five"> <div class = "a"> A </div>
We can see that the rendering effect of adding multiple attributes to the jQuery class appears in an embedded style.
The class added by jQuer for the element has a higher priority than the embedded style.
The rendering effect does not contain the background-color: gray; and color: yellow; Attributes of funny.
The above jQuery's priority-level method (recommended) for adding style attributes is all the content shared by the editor. I hope you can give us a reference and support for the guests.