Applying accordion

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script> // jquery <script type="text/javascript"> $(document).ready(function(){ $(".accordion h3:first").addClass("active"); $(".accordion p:not(:first)").hide(); $(".accordion h3").click(function(){ $(this).next("p").slideToggle("slow") .siblings("p:visible").slideUp("slow"); $(this).toggleClass("active"); $(this).siblings("h3").removeClass("active"); }); }); </script> 

Swears on the first line of code. Writes missing ; before statement missing ; before statement
What is the problem?

    2 answers 2

    The error is above this piece of code. Check out what comes before it. Or throw off the extended source.

    You have not connected the jQuery library. Without it, nothing will work.

    • Completed the question. - new_russian_man
    • one
      If you have this project on the server, could you give me a link? In order to make it possible to better understand the problem. So rather difficult. As I said, the error is most likely in the code before js. to check it, write the following <script> alert (1); </ script> instead of your code; if the error still exists, then it is definitely in the code above. - Daniel Vendolin September

    No, the error is here:

     $(this).next("p").slideToggle("slow") 

    ";" forgotten after line

    And before

     .siblings("p:visible").slideUp("slow"); 

    most likely should also be " $ (this) "

    • Then I would not swear on the first line. - Daniel Vendolin September
    • @ Daniel Vendolin, well, even if the error is not in this, then in any case - this is a mistake - DemoS
    • one
      $ (this) .next ("p"). slideToggle ("slow"). siblings ("p: visible"). slideUp ("slow"); - this is all one rule. - Daniel Vendolin September
    • Well, then you need to write in one line - DemoS
    • No, this is not fundamental, for perception - yes, better. But the work does not affect. - Daniel Vendolin September