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

167
Views
¿Cómo me deshago de que la propiedad 'getElementById' no existe en el tipo 'nunca []'?

tengo

 let accountNumber = (document.getElementById("lash-phone") as HTMLInputElement).value;

dentro de una función en TypeScript reacciona, pero arroja este error

 Property 'getElementById' does not exist on type 'never[]'. TS2339

y este mismo codigo sirve para otras pantallas

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

0

TS no puede seleccionar el tipo de document por sí mismo, por lo que puede informarle cuál es el tipo:

 const lashPhone = (document as Document).getElementById('lash-phone') as HTMLInputElement;
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!