Javascript examples for DOM HTML Element:Title
Title text Property - Change the text of the document's title:
<!DOCTYPE html> <html> <head> <title>HTML DOM Objects</title> </head>/*from www . ja v a2 s . c o m*/ <body> <p>Click the button to change the text of the document's title.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementsByTagName("TITLE")[0].text = "A new title text.."; document.getElementById("demo").innerHTML = "changed"; } </script> </body> </html>