You are here: Reference > JavaScript > client-side > HTML DOM > properties > name (meta)

name property (meta)

Browser support:
Sets or retrieves the name given to the meta information. Use it with the content property attribute to create a well-defined meta tag.

Syntax:

object.name;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: name

Possible values:

String that sets or retrieves a predefined type or a type defined by the user.
The following are predefined types:
abstract
Defines a secondary description.
author
Records the name of the author of the document.
<meta name="author" content="dottoro.com" />
classification
Classify the site into the appropriate category.
copyright
Used to include copyright information into the document.
<meta name="copyright" content="© 2009 Dottoro.com" />
description
Some search engines pick up this description to show with the results of searches.
<meta name="description" content="...Help page for meta tag..." />
distribution
Declares whether the document is available to the web or on an intranet.
web - The document is available for the full internet.
intranet - The document is only available for intranet use.
<meta name="distribution" content="web" />
doc-class
Indicates completion status of the document.
doc-rights
Indicates copyright status of the document.
doc-type
Specifies the type of the document.
DownloadOptions
The associated content property determines what buttons are visible on the File Download dialog box.
expires
Specifies the date and time when the page expires.
<meta name="expires" content="Wed, 9 Nov 2011 12:00:00 GMT" />
generator
The name of the program that created the document.
googlebot
This is an addition to the robots META Command, it informs only the Google search engine about indexing, archiving and link following rules.
noarchive - Prevent the Google search engine from archiving the page
nofollow - The page can be indexed, but links should not be followed.
noindex - Google robots should follow links, but should not index the page.
nosnippet - Prevent the Google search engine from saving snippets and archiving the document.
<meta name="googlebot" content="noarchive" />
keywords
Informs search engines what your web site or page is about. It is recommended to always specify this type of meta, because it is needed by search engines to catalogize the page.
<meta name="keywords" content="help, html help, JavaScript help, CSS help, manual ..." />
MSSmartTagsPreventParsing
Use this tag to prevent any Microsoft product from automatically generating smart tags.
name
The name of the document.
owner
Defines the owner of the page or site.
progid
Indicates of the document's default editor
rating
A simple rating for a site.
refresh
Indicates that the document displays for a specified amount of time before switching to a new URL or refreshing the current page. Useful for redirecting browsers to other pages, or to refresh the current page (news page).
<meta name="refresh" content="15" /> <meta name="refresh" content="15;URL=http://www.dottoro.com" />
reply-to
Email address of a contact for the document.
resource-type
Indicates the type of web resource.
revisit-after
Defines how often search engine spiders should revisit your site.
robots
Defines page indexing mechanisms for robots, search engine indexing and link following rules.
The content property should contain a comma separated list of the following values:
ALL - Robots should follow links, index and archive this page.
FOLLOW - Search engine robots should follow links from this page.
INDEX - Robots should include and index this page.
NOARCHIVE - Prevent search engines from archiving the page.
NOINDEX - Robots should follow links, but should not index the page.
NOFOLLOW - The page can be indexed, but links should not be followed.
NONE - Search engine robots can ignore the page.
<meta name="robots" content="ALL" /> <meta name="robots" content="INDEX,NOFOLLOW" />
Template
The associated content property specifies the location of the template used to edit the document.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the name attribute:
<head>
    <meta name="author" content="dottoro.com" />
    <meta name="copyright" content="&copy; 2009 Dottoro.com" />
    <meta name="description" content="...Help page for meta tag..." />
    <meta name="robots" content="ALL" />
</head>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the name property:
<head>
    <meta name="author" content="dottoro.com" />
    <meta name="copyright" content="&copy; 2009 Dottoro.com" />
    <meta name="description" content="...Help page for meta tag..." />
    <meta name="robots" content="ALL" />
    <script type="text/javascript">
        function GetName () {
            var metaTags = document.getElementsByTagName ("meta");

            for (var i = 0; i < metaTags.length; i++) {
                alert ("The value of the name property in the " + (i+1) + ". meta tag: " +metaTags[i].name);
            }
        }
    </script>
</head>
<body >
    <button onclick="GetName ();">Get NAME values!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content