HTML DOM titleProperty
Document Object
Definition and Usage
The title property returns the title of the current document (the text within the HTML title element).
Syntax
document.title
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the title property.
Examples
Examples
Return the title of the current document:
<html>
<head>
<title>My title</title>
</head>
<body>
The title of the document is:
<script>
document.write(document.title);
</script>
</body>
</html>
<head>
<title>My title</title>
</head>
<body>
The title of the document is:
<script>
document.write(document.title);
</script>
</body>
</html>
Try it Yourself »
Document Object Other Extensions