How to work with document.title in JavaScript?

HTMLJavascriptProgramming Scripts

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>
raja
Published on 26-Feb-2018 10:57:43
Advertisements