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

300
Views
Jquery Syntax error, unrecognized expression on attribute selector

I have html div with one attribute.

div exp_attribute="{"prop_val_name":1}">mydiv</div>

I tried to trigger click on it via jQuery like

$('div[exp_attribute={"prop_val_name":1}]').click();   // not working
$('div[exp_attribute=\\{"prop_val_name":1\\}]').click();   // not working with escaping special chars
$('div[exp_attribute=\\{\\"prop_val_name\\":1\\}]').click();   // not working with escaping more special chars

but keep getting error

Error: Syntax error, unrecognized expression: div[exp_attribute=\{\"prop_val_name\":1\}]

so any idea how to handle the issue?

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

0

Better to escape everything

$('div[exp_attribute=\\{\\"prop_val_name\\"\\:1\\}]').click();
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!