DOM Document.head Property
The head property returns the page's head element, where you can add style sheets, scripts and meta tags with JavaScript.
Description
The read-only head property returns the document's <head> element. It's used to add elements such as <link>, <style>, <script> and <meta> dynamically.
It always exists in HTML documents, even when the source has no <head> tag, because the parser creates one. Use it to find existing tags too, such as document.head.querySelector('meta[name=description]') to read or update the page description.
Scripts added dynamically to the head with createElement('script') load asynchronously by default. Setting defer has no effect on them; set async = false if several dynamic scripts must run in order.
Syntax
document.headValue
The document's <head> element.
Example
Browser Support
The following information will show you the current browser support for the Document.head property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





