Click to show new image - Javascript jQuery

Javascript examples for jQuery:Mouse Event

Description

Click to show new image

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//  w  w  w. jav a2  s  .c om
$('img').click(function() {
    $(this).attr('src', 'http://www.java2s.com/style/demo/InternetExplorer.png');
});
    });

      </script> 
 </head> 
 <body> 
  <div id="slideshow"> 
   <img class="one" src="http://www.java2s.com/style/demo/Opera.png" alt="Slide" id="slideShow"> 
  </div>  
 </body>
</html>

Related Tutorials