Todays JS workout: Getting the real dimensions of an image
myImg.addEventListener('onload', function() {
console.log('Width: ', this.naturalWidth);
console.log('Height: ', this.naturalHeight);
});
should be
myImg.addEventListener('load', function() {
console.log('Width: ', this.naturalWidth);
console.log('Height: ', this.naturalHeight);
});
or
myImg.onload = function() {
console.log('Width: ', this.naturalWidth);
console.log('Height: ', this.naturalHeight);
};