JavaScript – DOM Element focus() Method
The Element focus() method gives focus to an element if it can receive focus.
The Element focus() method gives focus to an element if it can receive focus.
The Element firstChild property returns the first child node of a node.
The Element firstElementChild property returns the first child element of the specified element.
The Element getAttribute() method returns the value of an element’s attribute.
The Element getAttributeNode() method returns an element’s attribute.
The Element getBoundingClientRect() method returns the size of an element, and its position relative to the viewport.
The Element getElementsByClassName() method returns a collection of child elements with a given class name.
The Element getElementsByClassName() method returns a collection of child elements with a given tag name.
The Element hasAttribute() method returns “true” if the attribute exists, and “false” if it does not exist.
The Element hasAttributes() method returns “true” if a node has attributes, and “false” if it does not.
The Element hasChildNodes() method returns “true” if the specified node has any child nodes, and “false” if it does not have any child nodes.
The Element id property sets or returns the value of an element’s id attribute.
The Element innerHTML property sets or returns the HTML content of an element.
The Element innerText property sets or returns the text content of an element.
The Element insertAdjacentElement() method inserts an element into a specified position.
The Element insertAdjacentHTML() method inserts HTML code into a specified position.
The Element insertAdjacentText() method inserts text into a specified position.
The Element insertBefore() method inserts a child node before an existing child node.
The Element isContentEditable property returns “true” if the content of an element is editable, and “false” if it is not editable.
The Element isDefaultNamespace() method returns “true” if the elements’s namespace is default, and “false” if it is not.