HTML DOM Document head attribute
- Sannan hasFocus()
- Sannan images
- Turbuwa zuwa sannan HTML DOM Documents
Definition and usage
head
This property returns the document's <head> element.
Tip
If there is no <head> element, HTML will add an empty element.
If there are multiple <head> elements, this property returns the first one.
See also:
Instance
Example 1
Get the tag name of <head> element:
document.head.tagName;
Example 2
Try using a document without <head> element:
document.head.tagName;
Example 3
Get the tag name of the first child element of <head> element:
document.head.firstElementChildtagName;
Example 4
You can also use getElementsByTagName("head") to access <head> element:
getElementsByTagName("head")[0].tagName;
Syntax
document.head
Return value
Type | Description |
---|---|
Node | Document head element. |
Browser support
document.head
A dake a dake 3 (2004) datti.
Dukiya duk browsers suna ɗaukar su:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Dukiya | 9-11 | Dukiya | Dukiya | Dukiya | Dukiya |
- Sannan hasFocus()
- Sannan images
- Turbuwa zuwa sannan HTML DOM Documents