Verify the Image loade

Identify weather an image is been loaded or not, using image load and error events.

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<img />

CSS

img{
  height: 100px;
  width: 100px;
}

JavaScript

$(document).ready(function() {

  $("img").attr("src", "http://jsfiddle.net/img/logo.png");

  $("img").on("load", function() {
    alert(" Image Exists...!");

  }).on("error ", function() {
    alert("ERROR");

  });

}); // doc ready