Paul Paul - 8 months ago 51
Javascript Question

event click firing on page load

beginner question with javaScript and jQuery. I can post the html if necessary. I have a div with an id of "container" that when clicked should make a text div with id of "text" appear. So my javaScript code so far:

$(document).ready(function (){

The problem is that the fading happens when the page loads. Can someone explain why? Many thanks,



Pass function to click:

$(document).ready(function (){
   $("#container").click(function() { $("#text").fadeIn(500) } );