欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

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

本文實例講述了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代碼運(yùn)行工具http://tools.jb51.net/code/HtmlJsRun測試上述代碼,可得如下運(yùn)行效果:

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

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

相關(guān)文章

最新評論