Get document title in JavaScript
Description
The following code shows how to get document title.
Example
<!DOCTYPE HTML>
<html>
<body>
<script>
<!--from ww w . j a va2 s. c om-->
document.writeln("title: " + document.title);
</script>
</body>
</html>
The code above generates the following result.
Javascript Tutorial Properties
Find out the compatMode for the document in...
Get HTML elements by its tag name in JavaSc...
Get HTML elements by name attribute in Java...
Get URL that linked to the current document...
Get all image elements in a HTML document i...
Get current page host in JavaScript
Get current page host name in JavaScript
Get current page location hash in JavaScrip...
Get current page path name in JavaScript
Get current page port number in JavaScript
Get current page protocol in JavaScript
Get current query string in the URL in Java...
Get document defaultCharset in JavaScript
Get information about the implementation of...
Get the URL of the current document using d...
Get the URL of the current document with do...
Get the body element as HTMLBodyElement usi...
Get the document character encoding in Java...
Get the last modified time of a HTML docume...
Get window object from document with docume...
Output document dir in JavaScript
Output document domain in JavaScript
Find out the compatMode for the document in...
Get HTML elements by its tag name in JavaSc...
Get HTML elements by name attribute in Java...
Get URL that linked to the current document...
Get all image elements in a HTML document i...
Get current page host in JavaScript
Get current page host name in JavaScript
Get current page location hash in JavaScrip...
Get current page path name in JavaScript
Get current page port number in JavaScript
Get current page protocol in JavaScript
Get current query string in the URL in Java...
Get document defaultCharset in JavaScript
Get document title in JavaScript
Get elements by its class names in JavaScri...Get information about the implementation of...
Get the URL of the current document using d...
Get the URL of the current document with do...
Get the body element as HTMLBodyElement usi...
Get the document character encoding in Java...
Get the last modified time of a HTML docume...
Get window object from document with docume...
Output document dir in JavaScript
Output document domain in JavaScript