document.title
In this chapter you will learn:
Document titme
document.title
returns the document title, changes the document title.
<!DOCTYPE HTML> <!-- ja v a 2 s .co m-->
<html>
<body>
<script>
document.writeln("<pre>");
document.writeln("compatMode: " + document.compatMode);
document.writeln("dir: " + document.dir);
document.writeln("domain: " + document.domain);
document.writeln("referrer: " + document.referrer);
document.writeln("title: " + document.title);
document.write("</pre>");
</script>
</body>
</html>
Change the document title
The following code changes the document title.
<!DOCTYPE HTML> <!--from j a v a 2 s. c om-->
<html>
<body>
<script>
document.writeln("<pre>");
document.writeln("compatMode: " + document.compatMode);
document.writeln("dir: " + document.dir);
document.writeln("domain: " + document.domain);
document.writeln("referrer: " + document.referrer);
document.writeln("title: " + document.title);
document.write("</pre>");
document.title = "new title";
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Document