+ 1
JS help
Hi, Is it possible to build a hidden stuff like <div id="hiddenDiv" > <label>... </label>... </div> And make it visible with JS (for example after I clicked a button with onclick() ) ? and how can i hide it. Thanks.
2 Answers
+ 1
Sure. You just need to ser display:none to hiddenDiv then via javascript you add display:block to id.
First make button in html with id button
You need to tako div and button to variable
var div = document.getElementById("hiddenDiv") ;
var button = document.getElementById("button") ;
button.addEventListener("click", function() {
div.style.display = "none" ;
} )
Was typing on phone, sry if code have typo
+ 1
Yes! thank you so much, that helps me a lot.