html - How do I get Jquery to toggle display -
I am creating a FAQ page that displays for the answer.
Here is Jquery
$ (document) .ready (function () {$ ('. Faqlink'). Click (function () {$ ('. Hide (FIP) '). Hide (); $ (this) .next (' hidden FAQ '). Show ();});}); css
.hiddenFAQ {display: none; } and HTML
& lt; One class = "faqlink" href = "#" & gt; Link 1 & lt; / A & gt; & Lt; div class = "hidden FAQ" & gt; & Lt; P & gt; Larem ipsum & lt; / P & gt; & Lt; / Div & gt; It will appear now, but the only way to remove it is to refresh the page. How do I create a toggle instead? Thanks
Use instead:
$ (document). Click (function () ($ ('. Faqlink'). (Function () {$ (this) .next ('hidden'). Toggle ();});});
Comments
Post a Comment