0
我想隐藏按钮,当我点击它。但是当我点击按钮时,我希望显示我的内容。如何隐藏按钮,当我点击按钮来显示内容?
#sectiontohide{
display: none;}
function toggle_div_fun(id) {
var divelement = document.getElementById(id);
if(divelement.style.display == 'none')
divelement.style.display = 'block';
else
divelement.style.display = 'none';
}
<button onclick="toggle_div_fun('sectiontohide');">Display Content</button>
<div id="sectiontohide">`
this is the content i'd like to show when i click the button and button should disappear
[隐藏按钮的可能的复制点击](http://stackoverflow.com/questions/32373038/hiding-a-button-on-click) – BSMP