Assign value to the document title (you must have the title tag in your html document) : title « Document « JavaScript Tutorial






<html>
<head>
<title>Untitled</title>

<script language="javascript" type="text/javascript">

function changeTitle()
{
    var newTitle = prompt("A title.", "default title");
    window.document.title = newTitle;
}

</script>
</head>

<body>

<P>You can change <a href="javascript:changeTitle()">
the &lt;title&gt; element</a> on this page</p>

</body>
</html>








14.34.title
14.34.1.document.title
14.34.2.Assign value to the document title (you must have the title tag in your html document)