querySelector(“CSS Selector”)
The method querySelector() returns the first Element match of the specified selector or group of selectors. If no matches are found, null is returned.
querySelectorAll(“CSS Selector”)
The method querySelectorAll() returns a static (not live) NodeList representing a list of the document’s elements that match the specified group of selectors.
- The NodeList object represents a collection of nodes. The nodes can be accessed by index numbers. The index starts at 0.
- You can use the length property of the NodeList object to determine the number of elements that matches the specified selector, then you can loop through all elements and extract the info you want.
- If the specified selectors include a CSS pseudo-element, the returned list is always empty.
querySelectorAll(“CSS Selector”)
querySelectorAll(“CSS Selector”)
More specific
querySelectorAll(“CSS Selector”)
- Length Property
- Loop
innerHTML
The innerHTML property defines the HTML content.
Latest posts by rajeshkumar (see all)
- Astropilot: Elevating Pilot Training to New Heights - December 28, 2024
- Discover Ranchi with Motoshare’s Bike and Car Rental Services - December 16, 2024
- Explore Mumbai with Motoshare’s Easy Bike and Car Rentals - December 16, 2024