Home >Web Front-end >HTML Tutorial >How to use document.title in JavaScript?
Use the document.title property to set the title of the document in JavaScript.
You can try running the following code to implement the document.title property in JavaScript.
Real-time demonstration
<!DOCTYPE html> <html> <head> <title>Demo Title</title> </head> <body> <script> var x = document.title; document.write("Our Title: "+x); </script> </body> </html>
The above is the detailed content of How to use document.title in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!