The title
property returns the title of the current document.
document.title
title |
Yes | Yes | Yes | Yes | Yes |
The following code shows how to get the title of the current document
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
</head><!--from w w w . j av a2 s . c om-->
<body>
The title of the document is:
<script>
document.write(document.title);
</script>
</body>
</html>
The code above is rendered as follows: