87,990
社区成员
发帖
与我相关
我的任务
分享<html>
<head>
<script>
hide = function(obj){
obj.style.visibility="hidden";
}
</script>
</head>
<body>
<input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/><input type="button" onclick="hide(this)" value="按钮"/><br/>
</body>
<html>document.getElementById("be").style.display="none";, 一个元素的ID名必须在页面内是唯一的, 当你存在多个同名的ID元素时, 后面的会把前面的给覆盖了, 则就当然只能隐藏最后一个按钮了