Get the content of the <title> tag from a requested html using jQuery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Get the content of the <title> tag from a requested html using jQuery

Demo Code

ResultView the demo in separate window


<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
   </head> 
   <body> 
      <script>
$.ajax({//from   w  ww . j ava 2s.c  o m
  url: 'http://java2s.com',
  success: function (data) {
    var title = $(data).filter('title').text();
    console.log( title );
  }
});

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

Related Tutorials