Why does jQuery or a DOM method such as getElementById not find the . . . What are the possible reasons for document getElementById, $("#id") or any other DOM method jQuery selector not finding the elements? Example problems include: jQuery silently failing to bind an event handler jQuery "getter" methods ( val(), html(), text()) returning undefined A standard DOM method returning null resulting in any of several errors: Uncaught TypeError: Cannot set property
$(document). ready and $(window). on(load) in jQuery 3. 4. 1 In the following example the console shows "window loaded" before "document loaded" when using jQuery 3 4 1 but when using jQuery 2 2 4 it always works as expected ("document loaded" appears before "window loaded")