Jessica | Javascript🚀
Jessica | Javascript🚀

@jesss_codes

7 Tweets 57 reads Jun 22, 2021
Ultimate Beginner Guide to master DOM in Web Development.
Thread🧵
The Dom Tree
The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document.
GetElementById method
The getElementById() method returns the element that has the ID attribute with the specified value. This method is one of the most common methods in the HTML DOM and is used almost every time you want to manipulate an element on your document.
GetElementByName Method
The getElementsByName() method returns a collection of all elements in the document with the specified name (the value of the name attribute), as an HTMLCollection object.
GetElementsByTagName method
The getElementsByTagName() method returns a collection of all elements in the document with the specified tag name, as an HTMLCollection object. The HTMLCollection object represents a collection of nodes.
GetElementsByClassName method
The getElementsByClassName method of the Document interface returns an array-like object of all child elements which have all of the given class name(s). When called on the document object, the complete document is searched, including the root node.
QuerySelector method
The querySelector() method returns the first element that matches a specified CSS selector(s) in the document. ... If the selector matches an ID in the document that is used several times, it returns the first matching element.

Loading suggestions...