Parse an element's contents - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example

Description

Parse an element's contents

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.7.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from  ww  w  .  j  ava  2 s . co m*/
var str = "<img src='img1.jpg'/><br/><img src='img2.jpg'/><br/><img src='img3.jpg'/>",patt = /\w+\d+\.jpg+/g;
console.log(str.match(patt));
    });

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

Related Tutorials