Get the string enclosed in a tag in a string Jquery - Javascript jQuery

Javascript examples for jQuery:String

Description

Get the string enclosed in a tag in a string Jquery

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.10.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*www .j  a  v a 2 s .c om*/

var s = "something sometihng <details> I want this </details>";
console.log("abc");
console.log($($.parseHTML(s)).filter('details').text());

    });

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

Related Tutorials