Javascript examples for DOM:Document title
Document title Property - Change the title of the document:
<!DOCTYPE html> <html> <head> <title>My title</title> </head>// w ww . ja v a2 s.c o m <body> <button onclick="myFunction()">change the title of the document</button> <p id="demo"></p> <script> function myFunction() { document.title = "Some new title text"; document.getElementById("demo").innerHTML = "changed from 'My title' to 'some new title text'."; } </script> </body> </html>