Im completely new to Javascript, this is what i want:
Guy clicks on an element, so i trigger an onclick
and i want to run a JS function, all clear so i need a JS function, what this function needs to do:
- Check if the display of element
#mobilemenu
is block or none. - When it is block change it to none, when its none change it to block.
What i found so far was this:
function Change(){
document.getElementById("mobilemenu").style.display = "block"; }
But i am stuck on checking if it is currently block or none. I am kinda new to JS so maybe it is super easy (as i think) but i can't find a proper tutorial or some examples.
Thanks in advance!