Skip to main content

Questions tagged [query-selector]

A JavaScript function that returns the first element within the document (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors.

2 votes
1 answer
262 views

There is a web page I visit which I would like to print. However, I only want to print a couple of things on it, not everything. So, I am making a bookmarklet that I can use whenever I visit the page ...
S. Melted's user avatar
  • 221
5 votes
1 answer
128 views

Background and Code I am using the following JavaScript code to inject CSS classes into a webpage after the page has loaded. These classes act as selectors that I can use to pinpoint a table cell to ...
Dodzi Dzakuma's user avatar
2 votes
1 answer
99 views

As you can see, I am running a function for each of td of a specific table for finding text of the selected td. I have to change text inside that div so instead of coding more each function for change ...
Munkhdelger Tumenbayar's user avatar
5 votes
2 answers
161 views

I have the following function which opens a modal and puts some value into a div. It works but the function looks ugly, I hope for improvements (maybe more dynamic). ...
utdev's user avatar
  • 161
5 votes
1 answer
1k views

I'm basically trying to build a function that searches all nodes on the DOM to check for data attributes, then swap them out with whatever is stored with the "data-intl-" attribute. For example, if ...
Seeker's user avatar
  • 93
2 votes
1 answer
1k views

With native JavaScript, I intend to traverse a collection of elements in the DOM that contain a link and an image (and possibly other elements). The image may or may not be inside the link—in ...
purefusion's user avatar
15 votes
2 answers
416 views

I've been writing far too many routines in JavaScript that get a record from a an object or array based off a matching property, much like jQuery does with DOM elements. Since all the good names are ...
konijn's user avatar
  • 34.4k
2 votes
2 answers
225 views

I see that there are quite some words that are appearing double or more times in my code. I'm thinking there might be a more efficient way of writing this code, only I don't have the knowledge to do ...
Kid Diamond's user avatar
8 votes
1 answer
813 views

A few months ago, I wrote a query selector that seems to outperform the query selectors in the popular GP libraries by a pretty hefty margin. I'm wondering if I overlooked something. It seems odd that ...
Dagg's user avatar
  • 4,571