1、首先,打开html编辑器,新建html文件,例如:index.html,插入需要的表格。
<img alt=\"JavaScript怎么删除行\” alt=\”9e97d2237ff2a56f17ed9f2bd4ccdcb.png\” src=\”https://www.freexyz.cn/d/file/20210330/3dee43899a33c1541a560e4b83812cd5.png\” title=\”1617086356685562.png\” />
2、之后在index.html的<script>标签中,输入代码:$('button').click(function () {$(this).parent().parent().remove();});
。
3、浏览器运行index.html页面,点击第1行的删除按钮,确实删除了第1行,并且代码不是以行号的形式。
© 版权声明
THE END
暂无评论内容