Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
How do I wildcard match a class name inside querySelectorAll?

Suppose I have bunch of rows under foo bar row-id* class name pattern. How do I match all rows under that pattern using querySelectorAll?

document.querySelectorAll(".foo.bar.[=*row-id]")

This doesn't work as expected.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

[class^="foo bar row-id"] will match what you're looking for. This searches for all class staring with .foo bar row-id. You can swap class for any other HTML attribute as well.

[class$="foo bar row-id"] will match class ending with your query.

[class*="foo bar row-id"] will match all class that contains your query.

Example:

var items = document.querySelectorAll('[class^="foo bar row-id"]');

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!