The ready( fn ) method binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
This method is a replacement for using window.onload
Here is the simple syntax to use this method:
selector.ready( fn )
Here is the description of all the parameters used by this method:
fn: The function to be executed when the DOM is ready.
<html> <head> <script type="text/javascript" src="../../js/jquery-2.2.0.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function() { $("div").text("The DOM is now loaded..."); }); </script> <style> .div{ margin:10px;padding:12px; border:2px solid #666; width:200px; } </style> </head> <body> <div class="div" style="background-color:blue;"></div> </body> </html>
Your Query was successfully sent!