I am wondering when using Jquery, it is required to put all code inside
$(Docuemnt).ready(function() {
*****
other codes;
});
I am wondering when using Jquery, it is required to put all code inside
$(Docuemnt).ready(function() {
*****
other codes;
});
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
}