Sometimes we need to check if the images have been loaded in order to execute commands related to the images.
$('img').load(function() {
// images loaded successfully
});
We canĀ also check if one specific image has loaded by using the element's id or class.
$('#MyImage').load(function() {
// image loaded successfully
});