Element Object Methods & Properties Flashcards
Sets or returns the accesskey attribute of an element
element.accessKey
Attaches an event handler to the specified element
element.addEventListener( )
Adds a new child node, to an element, as the last child node
element.appendChild( )
Returns a NamedNodeMap of an element’s attributes
element.attributes
Removes focus from an element
element.blur( )
Returns the number of child elements an element has
element.childElementCount
Returns a collection of an element’s child nodes (including text and comment nodes)
element.childNodes
Returns a collection of an element’s child element (excluding text and comment nodes)
element.children
Returns the class name(s) of an element
element.classList
Sets or returns the value of the class attribute of an element
element.className
Simulates a mouse-click on an element
element.click( )
Returns the height of an element, including padding
element.clientHeight
Returns the width of the left border of an element
element.clientLeft
Returns the width of the top border of an element
element.clientTop
Returns the width of an element, including padding
element.clientWidth
Clones an element
element.contains( )
Compares the document position of two elements
element.compareDocumentPosition( )
Returns true if a node is a descendant of a node, othwerwise false
element.contains( )
Sets or returns whether the content of an element is editable or not
element.contentEditable
Sets or returns the value of the dir attribute of an element
element.dir
Returns the first child node of an element
element.firstChild
Returns the first child element of an element
element.firstElementChild
Gives focus to an element
element.focus( )
Returns the specified attribute value of an element node
element.getAttribute( )