Top "Selectors-api" questions

The Selectors API provides methods that make it quick and easy to retrieve Element nodes from the DOM by matching against a set of selectors.

How to use querySelectorAll only for elements that have a specific attribute set?

I'm trying to use document.querySelectorAll for all checkboxes that have the value attribute set. There are other checkboxes on …

javascript css-selectors selectors-api
Javascript .querySelector find <div> by innerTEXT

How can I find DIV with certain text? For example: <div> SomeText, text continues. </div> Trying …

javascript innertext selectors-api
querySelector, wildcard element match?

Is there a way to do a wildcard element name match using querySelector or querySelectorAll? I see support for wildcards …

javascript dom domparser selectors-api
Using querySelector with IDs that are numbers

From what I understand the HTML5 spec lets you use IDs that are numbers like this. <div id="1">&…

javascript html css-selectors selectors-api
Changing CSS pseudo-element styles via JavaScript

Is it possible to change a CSS pseudo-element style via JavaScript? For example, I want to dynamically set the color …

javascript css css-selectors pseudo-element selectors-api
querySelector search immediate children

I have some jquery-like function: function(elem) { return $('> someselector', elem); }; The question is how can i do the …

javascript css-selectors selectors-api
How to remove elements that were fetched using querySelectorAll?

This seems like something that would have a quick answer, but I can't find one. Maybe I'm searching the wrong …

javascript element selectors-api
Can I use a regular expression in querySelectorAll?

On a page I'm doing I will be ending up with custom link elements like this: <link rel="multiply" …

javascript regex hyperlink selectors-api
Getting selected options with querySelectorAll

I wonder if it's possible in Javascript to get the currently selected options in a <select multiple> field …

javascript html-select selectors-api