首页 > Web开发 > 详细

jquery 常用的备忘

时间:2015-12-04 12:44:56      阅读:314      评论:0      收藏:0      [点我收藏+]

1.table 取  tr 的 id值

<table class="table table-striped table-hover table-bordered" id="sample_editable_scaleuser">

 <thead>
    <tr>       
      <th>用户名</th> 
    <th>密码</th>           
  </tr>  
 </thead>            
 <tbody>   
 <c:forEach items="${list}" var="scaleUser">  
   <tr class="scaleUser-tr" id=${scaleUser.id}>          >                  <td>${scaleUser.name }</td>     
 <td>${scaleUser.password}</td>            
   </tr>

   </c:forEach>   
</tbody>           
 </table>


//取id值

$(document).on(click,#sample_editable_scaleuser a.edit,function(e){       
    e.preventDefault();

var nRow = $(this).parents(tr)[0];

var id=$("tr").eq(nRow.rowIndex).attr(id);

});

 

jquery 常用的备忘

原文:http://www.cnblogs.com/ike_li/p/5018806.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!