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

172
Views
no funciona como los eventos esperados a través de HTML no se pueden llamar en el script

HTML:

 <body> <script type="module" src="./script.js"></script> <div>Welcome to my first html page...</div> <div id="username">Another div tag</div> <p>This is a paragraph</p> <h1>Working on JS</h1> <button onclick="firstFunction()">Click</button> </body>

J/S:

 function firstFunction() { console.log("Hurry") }

Obtener error:

 Uncaught ReferenceError: firstFunction is not defined at HTMLButtonElement.onclick (index.html:17) onclick @ index.html:17

¿Cuál podría ser la causa de este error?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

No importe el script js como módulo. use el siguiente código en su lugar:

 <script src="./script.js"></script> `
about 4 years ago · Santiago Gelvez 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!