HTMLMetaElement: httpEquiv property - Web APIs | MDN

Value

A string.

Examples

Reading the http-equiv value of a meta element

The following example queries a <meta> element with an http-equiv attribute. The http-equiv attribute is logged to the console showing a refresh pragma directive that instructs the browser to refresh the page after a number of seconds defined by the content attribute:

js

// given <meta http-equiv="refresh" content="10" />
const meta = document.querySelector("meta[http-equiv]");
console.log(meta.httpEquiv);
// refresh
console.log(meta.content);
// 10

Specifications

Specification
HTML
# dom-meta-httpequiv

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.