Get Image Src from image title - Javascript jQuery

Javascript examples for jQuery:Image

Description

Get Image Src from image title

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

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

Related Tutorials