jquery掩藏某一行的方式:1、运用eq()方式获得特定行原素目标,词法为“原素目标.eq(行元素检索)”;2、运用hide()方式将获得过的特定行原素目标隐藏,词法为“行原素目标.hide(speed,callback)”。
本实例教程作业环境:windows10系统软件、jquery3.2.1版本号、Dell G3计算机。
jquery如何掩藏某一行
jquery中,需要掩藏某一行,必须通过hide()方式,一旦被挑的原素已经被表明,则掩藏该原素。
词法为:
$(selector).hide(speed,callback)
在其中:
实例如下所示:
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn1").click(function(){
$("tr").eq(1).hide();
});
});
</script>
</head>
<body>
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<button class="btn1">Hide</button>
</body>
</html>
输出结果:
点击图标以后:
有关视频教学强烈推荐:jQuery视频教学
以上就是关于jquery如何掩藏某一行的具体内容,大量欢迎关注AdminJS其他类似文章!