Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery image change on hover

<html>  
<head>  
<style>  
</style>  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>  
<script>  
$(document).ready(function(){  
  $(".image").hover(function(){  
    $(this).attr('src','https://jpeg.org/images/jpeg-home.jpg');  
    }, function(){  
    $(this).attr('src','https://jpeg.org/images/jpegsystems-home.jpg');  
  });  
});  
</script>  
</head>  
<body>  
<img class="image" src="https://jpeg.org/images/jpegsystems-home.jpg"></img>  
</body>  
</html>
Source by www.c-sharpcorner.com #
 
PREVIOUS NEXT
Tagged: #jquery #image #change #hover
ADD COMMENT
Topic
Name
5+8 =