Introduction to jQuery,


#1

I can't find the problem in my code.

It says, Oops, try again. Did you put document inside $() ?

my code in script.js is:

$(document).ready(function(){
$(document).ready();
});


#2

syntax:

$(document).ready(function() {
  
});

you already put the document inside $( ).


#3

That line can be removed. For now, leave the wrapper empty:

$(document).ready(function(){
    // handler code will go here
});

The ready event is triggered when the DOM content is loaded. That means all the HTML is in place and can now be targeted and manipulated. This is known as deferrral. Script that runs before the content is in the DOM does nothing, and never runs again.


#4

It worked, thank you :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.