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

270
Views
Uncaught SyntaxError: Unexpected identifier when using HTMLCollectionOf<HTMLElement>

This is the line that gives me the error:

var modalList = document.getElementsByClassName("modal") as HTMLCollectionOf<HTMLElement>;

This was based off a HowTo tutorial found here, but my page will have multiple modal images so I changed a few things. I found many examples of casting the return value of .getElementsByClassName to HTMLCollectionOf<HTMLElement>, which is necessary in my case since I will be accessing some of the properties later. If most other examples work, why won't this one? My script tag is at the bottom of the body.

about 4 years ago · Juan Pablo Isaza
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!