title: How to find out the exact position of the mouse cursor when the user clicks a button in Javascript?
body: <p>I need to set the top and left px numbers for a div based on this data. How might one go about doing this?</p>
  
  <p>So basically when a user clicks on this element. I have a <code>showcontent</code> function which shows/hides content. But I need to set the top by finding the position of cursor</p>
  
  <pre><code>function ShowContent(d) {  
      document.getElementById(d).style.display = "block";  
  }
  </code></pre>