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

:focus

:focus selector

version added: 1.6jQuery(':focus')

描述 選擇當(dāng)前獲取焦點(diǎn)的元素。

如同其他偽類選擇器(那些以":"開(kāi)始),建議:focus前面用標(biāo)記名稱或其他選擇;否則,通用選擇("*")是不言而喻的。換句話說(shuō),$(':focus')等同為$('*:focus')。如果你正在尋找當(dāng)前的焦點(diǎn)元素,$( document.activeElement )將檢索,而不必搜索整個(gè)DOM樹(shù)。

Example:

Adds the focused class to whatever element has focus

<!DOCTYPE html>
  <html>
  <head>
  <style>
  .focused {
  background: #abcdef;
  }
  </style>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  </head>
  <body>
  
  <input tabIndex="1">
  <input tabIndex="2">
  <select tabIndex="3">
  <option>select menu</option>
  </select>
  <div tabIndex="4">
  a div
  </div>
<script>
  $("*").live("focus blur", function(e) {
  var el = $(this);
  setTimeout(function() {
  el.toggleClass("focused", el.is(":focus"));
  }, 0);
  });
  </script>
</body>
  </html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
梨树县| 周口市| 来安县| 石狮市| 嘉兴市| 武鸣县| 江都市| 巧家县| 吉林省| 竹溪县| 浮山县| 邮箱| 龙游县| 康平县| 白水县| 大丰市| 定南县| 四会市| 隆德县| 玉田县| 内丘县| 龙江县| 灌南县| 华蓥市| 金川县| 麻江县| 信阳市| 本溪| 吉木萨尔县| 云梦县| 平阳县| 皮山县| 利辛县| 东乡族自治县| 曲沃县| 北川| 韩城市| 吴桥县| 宜城市| 娱乐| 伊金霍洛旗|