Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 content Property
CONTENT Attribute | content Property

Sets or retrieves meta-information to associate with httpEquiv or name.

Syntax

HTML<ELEMENT CONTENT = vContent... >
Scripting[ vContent = ] object.content

Possible Values

vContentString that specifies or receives one of the following values.
description
Meta-information.
refresh
Integer consisting of the number of seconds to elapse before the document is refreshed. This value requires the httpEquiv to be set with the refresh value.
url
Location that is loaded when the document is refreshed. This value requires the httpEquiv to be set with the refresh value.
mimetype
MIME type used for the charset value.
charset
Character set of the document. This value requires the mimetype value to be set with a valid MIME type, and the httpEquiv to be set with the refresh value.
noopen
Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2) and later. Hides the Open or Run button on the File Download dialog box. This value requires the name attribute to be set with the DownloadOptions value.
nosave
Internet Explorer 6 for Windows XP SP2 and later. Hides the Save button on the File Download dialog box. This value requires the name attribute to be set with the DownloadOptions value.
x-ua-compatible
Windows Internet Explorer 8 and later. A semi-colon delimited list of document compatibility modes supported by the Web page. This value requires the httpEquiv to be set with the x-ua-compatible value.

The property is read/write. The property has no default value.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are not supported in IE8 mode. For more information, see About Dynamic Properties.

Remarks

Developers using the httpEquiv and content attributes to refresh web pages from alternate URL's should treat the value of content as untrusted data. For more information, please see Security Considerations: Dynamic HTML.

 New for Internet Explorer 8 

As of Internet Explorer 8, httpEquiv also supports a value of x-ua-compatible, which allows content to specify the document compatibility modes supported by a Web page, using a string containing one or more of the following values.

ValueDescription
IE=8Web page supports IE8 mode, which is also called "IE8 standards mode."
IE=7Web page supports IE7 mode, which is also called "IE7 standards mode."
IE=5Web page supports IE5 mode, which is also called "quirks mode."
IE=EmulateIE8If the Web page specifies a standards-based DOCTYPE directive, the page supports IE8 mode; otherwise, it supports IE5 mode ("quirks mode").
IE=EmulateIE7If the Web page specifies a standards-based DOCTYPE directive, the page supports IE7 mode; otherwise, it supports IE5 mode ("quirks mode").
IE=EdgeWeb page supports the highest mode available to the version of Internet Explorer used to display the page. This option is generally intended for testing purposes.

Internet Explorer displays the page in the highest mode supported by the page. For more information, see Defining Document Compatibility.

Examples

This example causes the browser to reload the document every two seconds.

<META HTTP-EQUIV="REFRESH" CONTENT=2>

This example sets the character set for the document.

<META HTTP-EQUIV="Content-Type"
    CONTENT="text/html; CHARSET=Windows-1251">

This example disables theme support for the document.

<META HTTP-EQUIV="MSTHEMECOMPATIBLE" CONTENT="no">

This example tells Internet Explorer 8 that a Web page supports IE7 mode and IE8 mode, but not IE5 mode.

<META HTTP-EQUIV="X-UA-COMPATIBLE" CONTENT="IE=7;IE=8">

Standards Information

This property is defined in HTML 3.2 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

META, HTMLMetaElement Constructor
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker