第一次使用Javascript和jQuery

我第一次使用Javascript和jQuery,我不知道我做错了什么。 我有一个家庭作业,给我.html文件,我添加了行。

这是我的.html

   Jiggle Into JavaScript <!--  -->   

Press the buttons to change the box!

这是我的.js文件

 function index(){ var $box = $('#box'); $("#button1").click(function(){ $("#box").animate({height: 300px}); }); $("#button2").click(function(){ $("#box").css("color", "blue"); }); $("#button3").click(function(){ $("#box").fadeOut(); }); $("#button4").click(function(){ $("box").end(); }); }; $(document).ready(index); 

 function index(){ var $box = $('#box'); $("#button1").click(function(){ $("#box").animate({height: '300px'}); }); $("#button2").click(function(){ $("#box").css("background-color", "blue"); }); $("#button3").click(function(){ $("#box").fadeOut(); }); $("#button4").click(function(){ $("box").end(); }); }; $(document).ready(index); 
   

Press the buttons to change the box!