Baseline Widely available
The HTMLMetaElement.httpEquiv
property gets or sets the pragma directive or an HTTP response header name for the HTMLMetaElement.content
attribute. For more details on the possible values, see the http-equiv attribute.
A string.
Examples Reading thehttp-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:
// 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 Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4