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

103
Views
¿Hay alguna manera de saber qué botón se presionó sin crear un nuevo controlador en JS?

Quiero usar el mismo controlador de botones para un script JS estándar. ¿Hay alguna manera de usar algo como un controlador de eventos para obtener la ID del botón que se presionó y pasarlo a la subrutina?

Pseudocódigo para transmitir el punto

 document.addEventListener('buttonClick', (event) => { drawComponent(event.clientX, event.clientY, event.buttonID); })

Estoy usando ASP.Net MVC, electron y Razor View Engine si eso es relevante.

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

0

Usar evento.objetivo

 document.addEventListener('buttonClick', (event) => { console.log("element: " + event.target); drawComponent(event.clientX, event.clientY, event.buttonID); })
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!