Get the title from a context - Javascript jQuery

Javascript examples for jQuery:Text

Description

Get the title from a context

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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//  w w  w .  j av  a2s  . c  o m
var context = '<html><head><title>Hello</title></head><body><a href="#">Click Here</a><p>This is my sentence.</p>< /body></html >';
title = $(context).filter("title");
console.log(title.html());
    });

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

Related Tutorials