HTML and CSS Reference
In-Depth Information
JavaScript Element
Description
Element
A document element
Properties
attributes
An array of attributes associated with the element
childElementCount
The number of child elements
classList
The list of classes associated with the element
className
The name of the element's class
clientHeight
The height of the element content plus padding
clientWidth
The width of the element content plus padding
clientLeft
The space between the element's content and the left edge of its padding
clientTop
The space between the element's content and the top edge of its padding
dataset
The set of data attributes for the element
firstElementChild
The first child of the element, ignoring text and comment nodes
id
The element id
innerHTML
A text string containing the HTML or XML markup of the element
isContentEditable
A Boolean value indicating whether the content can be edited
lang
The value of the element's lang attribute
lastElementChild
The last child of the element, ignoring text and comment nodes
localName
The local name of the element
namespaceURI
The namespace URI of the element
nextElementSibling
The next sibling of the element, ignoring text and comment nodes
offsetHeight
The height of the element including the content, padding, and border
offsetWidth
The width of the element including the content, padding, and border
offsetLeft
The position of the left edge of the element relative to its parent element
offsetTop
The position of the top edge of the element relative to its parent element
offsetParent
The parent element that the offsetLeft and offsetTop properties reference
outerHTML
A text string containing the HTML or XML markup of the element including the
markup tags that enclose the element
prefix
The namespace prefix of the element
previousElementSibling
The previous sibling of the element, ignoring text and comment nodes
scrollHeight
The overall height of the element
scrollWidth
The overall width of the element
scrollLeft
The number of pixels that have scrolled off the left edge of the element
scrollTop
The number of pixels that have scrolled off the top edge of the element
style
The value of the inline style attribute associated with the element
tagName
The tag name of the element
title
The value of the title attribute
Methods
blur()
Transfers keyboard focus to the document body
click()
Simulates a click on the element
focus()
Transfers keyboard focus to the element
getAttribute( attribute )
Returns the value of attribute
getAttribute( namespace , local )
Returns namespace combined with the local name of the attribute
getBoundingClientRect()
Returns a ClientRect object bounding the element
Search WWH ::




Custom Search