html 点击按钮隐藏,点击另外一个按钮显示

<inputtype="button"value="开始"type="submit"onclick="newform.action='/work/saveWork';ne... <input type="button" value="开始" type="submit" onclick="newform.action='/work/saveWork';newform.submit();"/>
<input type="button" value="结束" type="submit" onclick="newform.action='/work/updata';newform.submit();"/>
展开
 我来答
wuyanmin
2017-03-03 · TA获得超过672个赞
知道小有建树答主
回答量:469
采纳率:0%
帮助的人:136万
展开全部
<div id="xxx" style="display:block">ないよう</div>
<input type="button" onClick="aaa()" value="隐藏">
<input type="button" onClick="aaa()" value="显示">

<script>
function aaa(){if(document.getElementById("xxx").style.display=="block"){document.getElementById("xxx").style.display="none";}else{document.getElementById("xxx").style.display="block";}
}

</script>
百度贴吧:安林网络吧
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
叶落红尘3
2017-02-27 · TA获得超过7459个赞
知道大有可为答主
回答量:5567
采纳率:50%
帮助的人:789万
展开全部
show和hide使用
追问
怎么用啊?应该在哪里添加
追答
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("#hide").click(function(){
    $("p").hide();
  });
  $("#show").click(function(){
    $("p").show();
  });
});
</script>
</head>
<body>
<p>如果你点击“隐藏” 按钮,我将会消失。</p>
<button id="hide">隐藏</button>
<button id="show">显示</button>
</body>
</html>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式