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

290
Views
Queryselector back slash x2d can't select 'xxx\x2dxxx'

e.g

<table lsdata="{1:'Ship\x2dTo\x20Location',4:true}">
</table>

It can't use string contains selector document.querySelector("table[lsdata*='Ship\x2d']") to select DOM like image: image

I read below pages but no answer

  • javascript - What chars needs escaping in querySelector? - Stack Overflow
  • internationalization - Which encoding uses the \x (backslash x) prefix? - Stack Overflow
  • javascript - What chars needs escaping in querySelector? - Stack Overflow
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to escape the \ but in this case \\ didn't seem to work so I tried with \\\\ and it worked:

const item = document.querySelector('table[lsdata*="Ship\\\\x2d"]')
console.log(item)
<table lsdata="{1:'Ship\x2dTo\x20Location',4:true}">
</table>

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!