How to check if the DOM is ready?
There are two points you can have the code executed with a complete DOM tree: "load" and "DOMContentLoaded". The later is fired much earlier than the latter. Document.ready function fires as soon as the DOM is loaded and ready to be manipulated by script. This function is the earliest point in the page load process where script can safely access element in the page's HTML DOM .
Or use the shortcut
- jQuery Interview Questions FAQ - 1
- jQuery Interview Questions FAQ - 2
- Is jQuery a programming language?
- Why do we need to go for JQuery?
- How to check jQuery version?
- How to multiple version of jQuery?
- What is jQuery CDN?
- Advantages of minified version of JQuery
- How to Use the jQuery load() Method
- Difference between document.ready() and body onload()?
- What is the use of param() method?
- How to work with jQuery parent(), children() and siblings()?
- Difference between parent() and parents() in jQuery?
- What does jQuery data() function do?