Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.3.0/lodash.js"></script> </head> <body> <script> window.onload = function() { // same as window.addEventListener('load', (event) => { alert('Page loaded'); // image loaded at this time alert(`Image size: ${img.offsetWidth}x${img.offsetHeight}`); }; </script> <img id="img" src="/uploads/media/default/0001/05/e9f3899d915c17845be51e839d5ba238f0404b07.png"> </body> </html>