Answer the question
In order to leave comments, you need to log in
How can I make the container appear when the button is clicked and removed when the button is clicked again?
There is a container:
<div id="nav" class="one">
<div class"one_s">Привет</div>
</div>
Answer the question
In order to leave comments, you need to log in
Cube Cube I
use jquery.
You need to add this container:
How to specify in your example that it is this container that needs to be added / removed on click?
If you are using jquery then .toggle() will help.
$("button").click(function() {
$("div").toggle();
});
<style>
#hello.hidden{
display:none
}
</style>
<div id="hello">Привет</div>
<button onclick="document.querySelector('#hello').classList.toggle('hidden')">click</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question