最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

:first-child Selector

first-child selector

version added: 1.1.4jQuery(':first-child')

描述: 選擇所有父級(jí)元素下的第一個(gè)子元素。

雖然:first只匹配一個(gè)單獨(dú)的元素,但是:first-child選擇器可以匹配超過(guò)一個(gè):為每個(gè)父級(jí)元素匹配第一個(gè)子元素。這相當(dāng)于:nth-child(1)。

Example:

Finds the first span in each matched div to underline and add a hover state.

<!DOCTYPE html>
<html>
<head>
  <style>
  span { color:#008; }
  span.sogreen { color:green; font-weight: bolder; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <div>
    <span>John,</span>
    <span>Karl,</span>
    <span>Brandon</span>

  </div>
  <div>
    <span>Glen,</span>
    <span>Tane,</span>
    <span>Ralph</span>

  </div>
<script>
    $("div span:first-child")
        .css("text-decoration", "underline")
        .hover(function () {
              $(this).addClass("sogreen");
            }, function () {
              $(this).removeClass("sogreen");
            });

</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
黄陵县| 建德市| 崇礼县| 冕宁县| 翁牛特旗| 收藏| 九龙城区| 永仁县| 米林县| 馆陶县| 邹城市| 新兴县| 大埔区| 贡山| 桐城市| 巴南区| 三江| 宝山区| 万盛区| 邵武市| 新野县| 临沧市| 定西市| 巴林左旗| 尼勒克县| 崇阳县| 克山县| 左权县| 察隅县| 富民县| 色达县| 辽宁省| 阿鲁科尔沁旗| 南川市| 邮箱| 遵义县| 顺昌县| 同仁县| 潜江市| 长治县| 尤溪县|