javascript - Jquery hide and show -


I am creating a simple FAQ page on my site. I only want to see the question, and when the user clicks on the question, then the answer should be shown. For some reason my code is not working Please review my code and tell me what I am doing.

html

  & lt; Div class = "copy" id = "about1" & gt; & Lt; H1 & gt; Mission & lt; / H1> & Lt; P & gt; Content content content content content content content content & lt; / P & gt; & Lt; H1 & gt; Games & lt; / H1> & Lt; P & gt; Content content content content content content content content & lt; / P & gt; & Lt; / Div & gt;   

JS

  $ (document) .ready (function () {$ ('.copy h1') .Onclick (Function () ($ ('.ppt'). Hide (); $ ('this'). Next ('P') Show ();});});   

CSS

  .copy p {display = none;}    

Comments