Easy Tutorial
❮ Jsref Valueof Boolean Prop Loc Search ❯

Meta name Attribute


Definition and Usage

The name attribute sets or returns the name of the content attribute information.

The value of the name attribute depends on the value of the content attribute.

The name attribute can be a predefined value or user-defined.

Syntax

Set the name attribute:

metaObject.name = "application-name|author|description|generator|keywords"

Return the name attribute:

metaObject.name
Value Description
application-name Specifies the name of the web application
author Defines the author of the document. Example: <meta name="author" content="tutorialpro.org">
description Specifies the page description. Search engines can use this description as a search result. Example: <meta name="description" content="Free programming tutorials">
generator Specifies the name of the tool used to generate the document. Example: <meta name="generator" content="FrontPage 4.0">
keywords Specifies the keywords for the webpage - used to inform search engines about the relevant keywords for the content. Example: <meta name="keywords" content="HTML, HTML DOM, JavaScript">

Browser Support

All major browsers support the name attribute.


Return Value

Type Description
String The value of the name attribute

Example

Display the value of the name attribute of the <meta> tag:

var x = document.getElementsByTagName("META");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
    txt = txt + "Name of "+(i+1)+". meta tag: "+x[i].name+"<br>";
}

❮ Jsref Valueof Boolean Prop Loc Search ❯