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

175
Views
Unexpected token ')', rogue parantheses no where to be found

I have a simple script that dynamically generates buttons. Clicking on a button generates an error message in the console: "Uncaught SyntaxError: Unexpected token ')' (at (index):1:8)". Why is this error being generated, and how do I prevent it?

<button onclick="delete();">A Pet</button>

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

0

delete is a keyword, and not valid as a function name. When the JS engine encounters delete() in the click handler body, it interprets it as a delete statement applied to (), which is an empty expression, and syntactically invalid.

To fix, use a non-keyword name. Note that it might be better to use addEventListener instead of an inline handler.

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!