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

211
Views
Extensión de Chrome: la adición del controlador de eventos de clic al botón no funciona

He estado tratando de agregar un controlador de eventos de clic en un botón en mi extensión de Chrome. No importa lo que intente, la función "guardar" no se activará al hacer clic en el botón. El archivo index.html se ve así:

 <!doctype html> <html> <head> </head> <body> <textarea id="notes" rows="4" cols="50"></textarea> <button id="save-button">Save</button> <script src="popup.js"></script> </body> </html>

Y el código para agregar el controlador de eventos al botón se ve así:

 function save() { console.log('SAVE TEST') } document.addEventListener('DOMContentLoaded', function () { const saveButton = document.getElementById('save-button') saveButton.addEventListener('click', save); });

He confirmado que se está llamando a saveButton.addEventListener . He buscado en todas partes en línea y parece que estoy haciendo las cosas bien, pero debo estar metiendo la pata en algún lugar que simplemente no puedo entender...

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!