亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery分組選擇器簡單用法示例

 更新時間:2019年04月04日 11:49:44   作者:戀戀玫瑰花  
這篇文章主要介紹了jQuery分組選擇器簡單用法,結合實例形式分析了使用jQuery分組選擇器動態(tài)設置頁面元素屬性相關操作技巧,需要的朋友可以參考下

本文實例講述了jQuery分組選擇器簡單用法。分享給大家供大家參考,具體如下:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>jQuery分組選擇器</title>
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  <script type="text/javascript">
    $(function(){
      // 注意:#content.title,.header.title無效
      $('.header, div.title, [title="foot"]').css('backgroundColor','red');
    });
  </script>
</head>
<body>
  <div class="header">header
    <div class="title">title</div>
  </div>
  <hr>
  <div id="content">
    content
    <div class="title">title</div>
    <div class="context">context</div>
    <div class="other">other</div>
  </div>
  <hr>
  <footer title='foot'>footer</footer>
</body>
</html>

這里使用在線HTML/CSS/JavaScript代碼運行工具http://tools.jb51.net/code/HtmlJsRun測試上述代碼,可得如下運行效果:

更多關于jQuery相關內(nèi)容感興趣的讀者可查看本站專題:《jQuery頁面元素操作技巧匯總》、《jQuery常見事件用法與技巧總結》、《jQuery常用插件及用法總結》、《jQuery擴展技巧總結》及《jquery選擇器用法總結

希望本文所述對大家jQuery程序設計有所幫助。

相關文章

最新評論