jQuery load() handle load event

Description

jQuery load() handle load event

View in separate window

<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>/*from ww  w . ja v a  2 s .  c o  m*/
<script>
$(document).ready(function(){
  $("img").load(function(){
    $("div").text("Image loaded");
  });
});
</script>
</head>
<body>

<img src="image4.png" alt="test" width="100" height="100">

<div>Image is currently loading.</div>

</body>
</html>



PreviousNext

Related