Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
How do we trigger an onClick event on all element inside an imaginary rectangle with a given coordinate in vanilla javascript?

How do we trigger an onClick event on all element inside an imaginary rectangle with a given coordinate in vanilla javascript? Let's assume that we have a rectangle with the following xy coordinate (0,30) (0,40) (30,30) (30,40), and I want to trigger an onClick event on every DOM element with class .select-element inside of that rectangle. How do I do this? Is it possible?

I saw there's this method

Document.elementFromPoint()

But triggering this method for every coordinate seems like a bad idea for performance issues.

https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint Also, it is relative to the viewport, and doesn't accept a flag for using the absolute coordinate of a DOM element.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda