Answer the question
In order to leave comments, you need to log in
How to do: when you click on the button, show the block, when you click again, hide (on pure js)?
How to do: when you click on the button, show the block, when you click again, hide (on pure js)?
https://codepen.io/anon/pen/vrddEK
Answer the question
In order to leave comments, you need to log in
var popup = document.querySelector('.popup');
var open = document.querySelector('.open');
popup.style.display = 'none'
open.addEventListener("click", function() {
if(popup.style.display == 'none') popup.style.display = 'block';
else popup.style.display = 'none'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question