Javascript examples for jQuery:Mouse Event
get image from div when click on it
<html> <head> <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> </head> //from w w w. jav a 2 s . co m <body> <div class="click"> <img class="img1" src="http://www.java2s.com/style/demo/Firefox.png"> </div> <div class="click"> <img class="img2" src="http://www.java2s.com/style/demo/Safari.png"> </div> <div class="content"></div> <script> $('.click').click(function() { $('.content').html($(this).find('img').clone()); }); </script> </body> </html>