jquery mouseenter and fadeTo

I want a div to be faded to opacity 1 when mouse enters, and to 0.5 when it leaves. This is my code:\[code\] <script> $(document).ready(function(){ $("#header").mouseenter(function(){ $("#header").fadeTo('fast', 1); }); $("#header").mouseleave(function(){ $("#header").fadeTo('fast', 0.5); }); } </script>\[/code\]HTML:\[code\]<body> <div id="header"> <h1>Hello!</h1> <p>blah blah...</p> </div></body>\[/code\]I have a div in the body containing one h1 and one p. Nothing happens when I move the mouse over it. Is something wrong?
 
Back
Top