Latest web development tutorials

HTML DOM title attribute

Document Object Reference Document Object

Definition and Usage

title property returns the current title (HTML title element text) document.

grammar

document.title


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the title attribute


Examples

Examples

Returns the title of the current document:

<html>
<head>
<title>My title</title>
</head>
<body>

文档的标题为:
<script>
document.write(document.title);
</script>

</body>
</html>

try it"


Document Object Reference Document Object