首页 > Web开发 > 详细

删除表格JQuery 效果

时间:2017-06-25 15:14:13      阅读:271      评论:0      收藏:0      [点我收藏+]

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格的删除和添加</title>
    <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
</head>
<body>
   <table border="1px" width="500px" id="ss">
        <tr>
             <th>姓名</th>
             <th>大小</th>
             <th>性别</th>
             <th>操作</th>
        </tr>
        <tr>
              <td>小强</td>
              <td>B</td>
              <td>男</td>
              <td><button onclick="fun(this)">删除</button></td>
        </tr>
        <tr>
            <td>大熊</td>
            <td>F</td>
            <td>男</td>
            <td><button onclick="fun(this)">删除</button></td>
        <hr>
            
        </tr>
   </table>    
</body>
<script type="text/javascript">
    // 删除
    function fun(ob){
        $(ob).parents("tr").remove();
    }
</script>
</html>

删除表格JQuery 效果

原文:http://www.cnblogs.com/kevin-yang520/p/7076801.html

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