0
window.onload VS onload in body tag
Can anyone provide a clear explanation about the difference between window.onload and onload in body tag? Thanks in advance.
1 Answer
+ 2
these are almost same...
they target the same property/variable (memory address)
the only slightly difference is that body attribute in html tag receive a string, while assigning properties in js (either window.onload or document.body.onload) receive a function ^^