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

144
Views
reactJs using both onMouseDown and onMouseMove to choose multiple elements while holding the mouse button down?

so basically I want the user to be able to kinda select multiple elements by just drawing over them instead of choosing each manually. what I tried to do was on each element I have this onMouseMove function, and inside that function I am using this:

document.body.onmousedown = function() {
  //Selecting the items here, only if the mouse is also down
}

but it doesnt seem to be working as on mousedown is only true the moment it is clicked. sorry if this has been answered before I tried searching I couldnt find it. Thank you all in advance.

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!