Open jesussuarz opened 4 years ago
Hi! It's very easy! I hope you understand.
$("#toggle-event").change(function() {
if ($('#toggle-event').is(":checked")){
$('.divforhide').hide(); //multi hide all divs
$('.divfordisplay').css('display', 'inline'); //multi show all divs
//or:
$("#first,#second,#third,#etc").hide() //multi hide all id's
$("#first,#second,#third,#etc").css('display', 'inline') //multi hide all id's
} else {
$('.divforhide').hide(); //multi hide all divs
$('.divfordisplay').css('display', 'inline'); //multi show all divs
//or:
$("#first,#second,#third,#etc").hide() //multi hide all id's
$("#first,#second,#third,#etc").css('display', 'inline') //multi show all id's
}
});
Don't forget to import jquery
I'm pretty new to javascript. so I need a little help with this.
I try to use this:
I will make a section of plans on my website, yearly and monthly.
You can see the example on this website: https://cangurohosting.com/hosting/
I need to start 1 div with a content and then when they click on the toggle then hide the first one and start the second one.
I hope you can understand me.