Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Work with Document Title in JavaScript



Use the document.title property to set the title of the document in JavaScript.

Example

You can try to run the following code to implement document.title property in JavaScript.

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Demo Title</title>
   </head>
   <body>
      <script>
         var x = document.title;
         document.write("Our Title: "+x);
      </script>
   </body>
</html>
Updated on: 2020-05-21T07:49:29+05:30

272 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements