简单的jQuery没有运行

Tom*_*ell -1 html javascript jquery google-chrome web

这个简单的jQuery代码没有运行.使用Chrome,启用Javascript.

<html>

<body>
    <h1>Click for info</h1>
    <p>Here is the extra information!</p>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready({

            $("p").hide();

            $("h1").click(function(){
                $(this).next().slideToggle(300);
            });
        });
    </script>

</body>
Run Code Online (Sandbox Code Playgroud)

谢谢你提供的所有帮助 :)

tym*_*eJV 5

$(document).ready({ 应该 $(document).ready(function() {

$(document).ready(function() {

    $("p").hide();

    $("h1").click(function(){
        $(this).next().slideToggle(300);
    });
});
Run Code Online (Sandbox Code Playgroud)