-1

I am wondering when using Jquery, it is required to put all code inside

$(Docuemnt).ready(function() {
     *****
     other codes;
});
Adam Lee
  • 23,314
  • 47
  • 144
  • 221

1 Answers1

0

No you just need to put the code which have to be executed when the page is load, for example all the onClick function.

You can have code like this :

$(Docuemnt).ready(function() {
     $('.myClass').on('Click', myFunction);
});

function myFunction(event) {
   //do some stuff
}
LolWalid
  • 515
  • 5
  • 15