Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Mousedown event on DIV - help urgent

Mousedown event on DIV - help urgent

Scheduled Pinned Locked Moved Web Development
javascriptgame-devhelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Venkat Eswaran
    wrote on last edited by
    #1

    hi all, I am creating a javascript puzzle game. I need to capture the mouuse down event on div tag only. we have mouusedoen event for document, button, link, i need for DIV tag. how to do?. I want to call a fuction on the mouse down event. If possib;e please send me a code for that. Thanks in advance. Venky

    M 1 Reply Last reply
    0
    • V Venkat Eswaran

      hi all, I am creating a javascript puzzle game. I need to capture the mouuse down event on div tag only. we have mouusedoen event for document, button, link, i need for DIV tag. how to do?. I want to call a fuction on the mouse down event. If possib;e please send me a code for that. Thanks in advance. Venky

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      How about just using the onmousedown event for the div? Here's a sample:

      <html>
      <body>
      <div id="myDiv1" onmousedown="alert('myDiv1 mousedown');">This is myDiv1.</div>
      <br /><br />
      <div id="myDiv2" onmousedown="alert('myDiv2 mousedown');">This is myDiv2.</div>
      </body>
      </html>

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups