Greetings Everyone from Alabama
I am writing a script to hide divs and containers with a click but the problem that i am running in to is that they are all linked to each because of the class used. I have tried to incorporate (this) into the script but nothing seems to work. Click one and they all open or close.
What i would like it to do is hide the element on page load and show each one when clicked.
- $(document).ready(function() {
-
- var hcon = $(".hide-content")
- var hbtn = $(".hide-btn")
-
- $(hcon).hide();
- $(hbtn).click(function() {
- $(hcon).slideToggle("slow");
- });
- });
Thank you for any help.
Aires