Apply substring on image url - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image

Description

Apply substring on image url

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//  w  ww  . ja v a 2  s.  c om
var string = 'url("http://www.java2s.com/style/download.png")';

string = string.substr(0, string.length - 2);

string = string.substr(5, string.length);
console.log(string);
console.log(string);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials