jQuery document read event
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Syntax</title> <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script> $(document).ready(function(){ // Some code to be executed... document.getElementById("demo").innerHTML = "Hello World!"; });/*from ww w . ja va 2 s. c om*/ </script> </head> <body> <p id="demo"></p> </body> </html>