(014)jquery_filter_过滤选择器has

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>f_html.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        ol
        {
            float: left;
            width: 180px;
        }
        ol li
        {
            float: left;
            width: 180px;
            height: 23px;
            line-height: 23px;
            margin: 2px 0px;
        }
        p
        {
            padding: 0px;
            margin: 0px;
        }
    </style>
    <script type="text/javascript" src="../js/jquery/jquery190.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("li:has('label')").css("background-color","pink");
        });
    </script>
  </head>
  
  <body>
        <div>改变包含"label"元素的背景色:</div>
        <ol>
            <li><p>我是P先生</p></li>
            <li><label>L妹纸就是我</label></li>
            <li><p>我也是P先生</p></li>
            <li><label>我也是L妹纸哦</label></li>
            <li><p>P先生就是我哦</p></li>
        </ol>
  </body>
  
</html>

 

posted @ 2014-12-08 16:10  雪中飞雁  阅读(76)  评论(0)    收藏  举报