Get the source of the image in one div to another - Javascript jQuery

Javascript examples for jQuery:Image

Description

Get the source of the image in one div to another

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.6.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from   w  w w .ja v a 2  s .co m*/
console.log( $('img').attr('src') );
console.log( $('img')[0].src );
    });

      </script> 
   </head> 
   <body> 
      <img src="http://www.java2s.com/style/download.png" alt="Arnold">  
   </body>
</html>

Related Tutorials