DOM Objects Flashcards
accessKey
Sets or returns the accesskey attribute of an element
appendChild()
Adds a new child node to an element
attributes
Returns a NamedNodeMap of an element’s attributes
blur()
Removes focus from an element
childElementCount
Returns a node list of all the elements child elements
childNodes
Returns a node list of an element’s child nodes
children
Returns an HTMLCollection of an elements child elements
classList
Returns the class name(s) of an element
className
Sets or returns the value of the class attribute of an element
click()
Simulates a mouse-click on an element
clientHeight
Returns the height of an element, including padding
clientLeft
Returns the width of the left border of an element
clientTop
Returns the width of the top border of an element
clientWidth
Returns the width of an element, including the padding
cloneNode()
Clones an element
closest()
Search the DOM tree for the closest element that matches a CSS selector
compareDocumentPosition()
Compares the document position of two elements
contains()
Returns true if a node is a descendent of a node
contentEditable
Sets or returns whether the content of an element is editable or not
dir
Sets or returns the value of the dir attribute of an element
exitFullScreen()
Cancels an element in full screen mode
firstChild
Returns the first child node of an element
focus()
Gives focus to an element
getAttribute()
Returns the value of an element’s attribute
getBoundingClientRect()
Returns the size of an element and its position relative to the viewpoint
getElementsByClassName()
Returns a collection of child elements with a given class name
getElementsByTagName()
Returns a collection of child elements with a given tag name
hasAttribute()
Returns true if an element has a given attribute
hasAttributes()
Returns true if an element has any attributes
hasChildNodes
Returns true if an element has any child nodes
id
Sets or returns the value of the id attribute of an element
innerHTML
Sets or returns the content of an element
innerText
Sets or returns the text content of a node and its decendants
insertAdjacentElement()
Inserts a new HTML formatted text at a position relative to an element
insertAdjacentHTML()
Insert an HTML formatted text at a position relative to an element
insertAdjacentText()
Inserts text into a position relative to an element
insertBefore()
Inserts a new child node before an existing child node
isContentEditable
Returns true if an element’s content is editable
isDefaultNamespace()
Returns true if a given namespaceURI is the default
isEqualNode()
Checks if two elements are equal
isSameNode()
Checks if two elements are the same node
isSupported()
Returns true if a feature is supported on the element
lang
Sets or returns the value of the lang attribute of an element
lastChild
Returns the last child node of an element
lastElementChild
Returns the last child node of an element
matches()
Returns true if an element is matched by a given CSS selector
namespaceURI
Returns the namespace URI of an element
nextSibling
Returns the next node at the same node tree level
nextElementSibling
Returns the next element at the same node tree level
nodeName
Returns the name of a node