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