How to work with document.title in JavaScript?

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


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

Live Demo

<!DOCTYPE html>
      <title>Demo Title</title>
         var x = document.title;
         document.write("Our Title: "+x);
Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician