HTML | DOM Meta httpEquiv Property
The HTML DOM Meta httpEquiv Property is used to set or returning the an HTTP header for the information in the content attribute. The HTML http-equiv Attribute is used to provide header information or value of the content Attribute. It can be used to simulate an HTTP Header response.
Syntax:
- It return the httpEquiv property:
metaObject.httpEquiv
- It is used to Set the httpEquiv property:
metaObject.httpEquiv = HTTP-he
Property values:
- content-type It Specifies the character set for the contents of the document.
- default-style It Specified the preferred style sheet to use.
- refresh It Defines a time interval for the document to refresh itself.
Examples:
<!DOCTYPE html> < html > < head > < meta http-equiv = "refresh" content = "30" > </ head > < body > < center > < h1 >GeeksForGeeks</ h1 > < h2 >DOM Meta http-equiv Property</ h2 > < p >Hello GeeksforGeeks!</ p > < button onclick = "myGeeks()" > Submit</ button > < p id = "sudo" ></ p > < script > function myGeeks() { var x = document.getElementsByTagName( "META")[0].httpEquiv; document.getElementById( "sudo").innerHTML = x; } </ script > </ center > </ body > </ html > |
Output:
Before Clicking On Button:
After Clicking On Button :
Supported Browsers: The browsers supported by DOM Meta httpEquiv Property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Apple Safari
- Opera
Please Login to comment...