Easy Tutorial
❮ Jsref Regexp Unicode Hex Prop Style Padding ❯

Meta httpEquiv Attribute


Definition and Usage

The httpEquiv attribute sets or returns the HTTP header information in the content attribute.

The http-equiv attribute can mimic HTTP response headers.

The http-equiv attribute value depends on the value of the content attribute.

Note: If the name attribute is set, the http-equiv attribute is not needed.

Syntax

Setting the httpEquiv attribute:

Returning the httpEquiv attribute:

Some common HTTP-header values:

Value Description
cache-control Controls the caching mechanism of the document. Allowed values: public - all content will be cached (client and proxy server can cache)<br>private - content is cached to private cache (only client can cache, proxy server cannot cache)<br>no-cache - no caching<br>no-store - cached but not archived example: <meta http-equiv="cache-control" content="no-cache">
content-language Language of the response body example: <meta http-equiv="content-language" content="en-US">
content-type MIME type of the returned content hint: often used for character set settings. example: <meta http-equiv="content-type" content="text/html; charset=UTF-8">
date Time the original server message was sent example: <meta http-equiv="date" content="Wed, 16 Feb 2011 22:34:13 GMT">
expires Expiration date and time of the response example: <meta http-equiv="expires" content="Fri, 30 Dec 2011 12:00:00 GMT">
last-modified Last modification time of the requested resource example: <meta http-equiv="last-modified" content="Mon, 03 Jan 2011 17:45:57 GMT">
location Used to redirect the recipient to a location other than the requested URL to complete the request or identify a new resource example: <meta http-equiv="location" content="URL=http://www.tutorialpro.org">
refresh Defines the interval after which the page refreshes. example: <meta http-equiv="refresh" content="300">
set-cookie Creates a cookie, including the cookie name, cookie value, and expiration time. example: <meta http-equiv="set-cookie" content="tutorialprocookie=myContent;expires=Fri, 30 Dec 2015 12:00:00 GMT; path=http://www.tutorialpro.org">
window-target Specifies the frame name to be loaded

Browser Support

All major browsers support the httpEquiv attribute.


Example

Display HTTP header information:

❮ Jsref Regexp Unicode Hex Prop Style Padding ❯