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

jQuery實(shí)現(xiàn)查找最近父節(jié)點(diǎn)的方法

 更新時(shí)間:2016年06月23日 09:06:12   作者:hbiao68  
這篇文章主要介紹了jQuery實(shí)現(xiàn)查找最近父節(jié)點(diǎn)的方法,涉及jQuery針對(duì)元素節(jié)點(diǎn)操作的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)查找最近父節(jié)點(diǎn)的方法。分享給大家供大家參考,具體如下:

這里演示查找當(dāng)前控件最近的table

<html>
  <head>
    <title>usually function</title>
  </head>
  <body>
    <table name="name_table1">
      <tr>
        <td>table1</td>
      </tr>
    </table>
    <table name="name_table2">
      <tr>
        <td>table2</td>
      </tr>
    </table>
    <table name="name_table3">
      <tr>
        <td>table3</td>
      </tr>
    </table>
  </body>
<html>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script>
$(function(){
  $("td").bind("click",function(){
    //alert($(this).html());
    alert($(this).closest("table").attr("name"));
  });
});
</script>

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery操作DOM節(jié)點(diǎn)方法總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jquery中Ajax用法總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)

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

相關(guān)文章

最新評(píng)論