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. ASP.NET
  4. How to get the coordinates on mouse-click?

How to get the coordinates on mouse-click?

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorialquestion
4 Posts 3 Posters 1 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.
  • S Offline
    S Offline
    sapnabn
    wrote on last edited by
    #1

    Hi, I dont know if this is the right place to post my problem, but I dont know where else to do it. I am doing a web page which helps the user to draw rectangle on the browser. The first problem i encountered is (may be very simple one), I dont know how to catch the coordinates of the mouse-click point using Javascript. :sigh: Can anybody please throw some light on this? - Sapna

    S 1 Reply Last reply
    0
    • S sapnabn

      Hi, I dont know if this is the right place to post my problem, but I dont know where else to do it. I am doing a web page which helps the user to draw rectangle on the browser. The first problem i encountered is (may be very simple one), I dont know how to catch the coordinates of the mouse-click point using Javascript. :sigh: Can anybody please throw some light on this? - Sapna

      S Offline
      S Offline
      Sarvesvara BVKS Dasa
      wrote on last edited by
      #2

      Write an event for 'OnClick' on the body of the page. There you can get all the coordinates There is nothing new under the sun,
      But there are lots of old things we don't know.

      - Ambrose Bierce

      A 1 Reply Last reply
      0
      • S Sarvesvara BVKS Dasa

        Write an event for 'OnClick' on the body of the page. There you can get all the coordinates There is nothing new under the sun,
        But there are lots of old things we don't know.

        - Ambrose Bierce

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Thank you! I dont have a good hand in client side scripting. Could you please elaborate? -Sapna

        S 1 Reply Last reply
        0
        • A Anonymous

          Thank you! I dont have a good hand in client side scripting. Could you please elaborate? -Sapna

          S Offline
          S Offline
          Sarvesvara BVKS Dasa
          wrote on last edited by
          #4

          Just a sample below. Copy the code into a new .html file and then try it function CallThis(obj) { // window.alert("LOAD"); } function CallClick(obj) { window.alert("CLICK"); window.alert(event.clientX); window.alert(event.clientY); } Click anywhere There is nothing new under the sun,
          But there are lots of old things we don't know.

          - Ambrose Bierce

          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