Gurpreet Arora

Gurpreet Arora

  • 701
  • 2.7k
  • 107.6k

Hide and show multiple div with a single button click ?

Jul 16 2018 1:03 AM
I am New to JS

I am trying Questions Page in javascript

Multiple Question Coming one by one
2 Button back and Next
i want when i check on next current div hide and next div(question) Show when click on back previous div show and current hide

Multiple div are there
Please help me
What I have tried:

$('a.slick-hide').bind('click', function(){
var $div1 = $('#box1'), $div2 = $('#box2')
if ( $':visible') ) {
} else if ( $':visible') && $':hidden) ) {
} else {
<script src=""></script>
<script src=""></script>
<script type="text/JavaScript" src="test.js">
<div id="box1">
<p> JavaScript is the programming language of HTML and the Web. <br />
Programming makes computers do what you want them to do. <br />
JavaScript is easy to learn. </p>
<div id="box2">
<a class="slick-hide" href="#">link</a>

Answers (3)