根据给定的类名匹配元素

 选择器                       描述                             返回                  示例  
 .class               根据给定的类名匹配元素                  集合元素
 
 node2:/var/www/html/jquery#cat t18.html 
<li id='aaa' class='mmmm'>1111111111</id>
<li id='test' class='nnnn'>222222222</id>
<li id='ccc' class='kkkkk'>3333333333</id>
<li id='ddd' class='hhhh'>44444444444</id>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="t18.js"></script>

node2:/var/www/html/jquery#cat t18.js
$(".kkkkk").css("background","red");

猜你喜欢

转载自blog.csdn.net/zhaoyangjian724/article/details/88531109