这篇文章主要介绍了jQuery给多个不同元素添加class样式的方法,实例分析了addClass()方法添加样式的技巧,非常具有实用价值,需要的朋友可以参考下
本文实例讲述了jQuery给多个不同元素添加class样式的方法。分享给大家供大家参考。具体分析如下:
jQuery可以通过addClass()方法给多个不同的html元素同时添加相同的class
.important { font-weight:bold; font-size:xx-large; } .blue { color:blue; }Heading 1
Heading 2
This is a paragraph.
This is another paragraph.
This is some important text!
希望本文所述对大家的jQuery程序设计有所帮助。
以上就是jQuery给多个不同元素添加class样式的方法的详细内容,更多请关注本站其它相关文章!