通过单击HTML中的另一个按钮使按钮不可见 [英] Making a button invisible by clicking another button in HTML
本文介绍了通过单击HTML中的另一个按钮使按钮不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过单击HTML中的另一个按钮使按钮不可见?
我的写法如下,但不起作用.
How can I make a button invisible by clicking another button in HTML?
I have written like below, but it doesn't work.
<input type="button" onclick="demoShow();" value="edit" />
<script type="text/javascript">
function demoShow()
{ document.getElementsByName('p2').style.visibility="hidden"; }
</script>
<input id="p2" type="submit" value="submit" name="submit" />
推荐答案
写这个
隐藏
{document.getElementById("p2").style.display="none";}
显示
{document.getElementById("p2").style.display="block";}
这篇关于通过单击HTML中的另一个按钮使按钮不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文