码迷,mamicode.com
首页 > 其他好文 > 详细

演示-联合选择器和反选择器

时间:2016-10-06 00:02:56      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

HTML代码:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <title>index</title>
 6 <script type="text/javascript" src="jquery-3.1.1.min.js"></script>
 7 <script type="text/javascript">    
 8     $(function(){
 9                $(".ull,a").css("color","red");
10                $("div :not(a)").css("color","blue");
11         }
12     );
13 </script>
14 </head>
15 <body>
16 <div style="border:1px solid;">
17     <a id="last" value="123" href="#">兴趣:</a>
18     <p>电影</p>
19 </div>
20 <ul class="ull">
21     <li>I</li>
22     <li>II</li>
23     <li>III</li>
24 </ul>
25 </body>
26 </html>

结果:

技术分享

 

演示-联合选择器和反选择器

标签:

原文地址:http://www.cnblogs.com/yw0219/p/5933064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!