Required. If you get the value attribute of a checkbox, ... Getting values of multiple selected checkboxes. In the querySelector() method if we pass the multiple selectors it will return the first element that matches the specified selectors. By using the querySelector(“a”).style.backgroundColor = “red”; we have passed the anchor tag (“a”) to the querySelector. The returned element depends on which element that is first found in the document (See "More Examples"). [2015-04-29 08:08:05] Previous methods were searching the DOM. One thing people often don’t realize is that you can pass in any valid CSS selector. Get the computed style properties or set CSS properties for an element. name A DOMString specifying the name of the attribute whose value is to be set. The following query selector contains two Explanation of the above code: In this example, we can observe that we have used two anchor tags and inside the anchor tag we have passed the hyperlink of two images. In “How To Access Elements in the DOM,” we reviewed the DOM methods for grabbing and working with nodes in vanilla JavaScript. Web hosting by Digital Ocean | CDN by StackPath, "". 1 Like "So, a valid unquoted attribute value in CSS is any string of text that is not the empty string, is not just a hyphen (-), consists of escaped characters and/or characters matching /[-_\u00A0-\u10FFFF]/ entirely, and doesn’t start with a digit or two hyphens or a hyphen followed by a digit. The HTMLOptionElement represents the