Javascript can only perform certain operations on DOM elements after they have been defined. This problem lies in "javascript execution order" http://www.jb51.net/article/44577.htm There is a detailed introduction in the article.
jQuery uses document.ready to ensure that the code to be executed is executed after the DOM element is loaded. For example, in the article "jQuery Basics - How to Get Started", I used the following jQuery code:
I would like to say: