skip to Main Content

Javascript – how do I hide an element depending on the variable?

num=1 document.getElementById("Num").innerHTML = num //button to increase/decrease num function next() { num++ document.getElementById("Num").innerHTML = num } function before() { num-- document.getElementById("Num").innerHTML = num } //hide and show asdf if (num=1){ document.getElementById("asdf").style.visibility = "hidden"; } else { document.getElementById("asdf").style.visibility = "visible"; }…

VIEW QUESTION
Back To Top
Search