title: In JS, how can I get the mouse coordinates inside a DIV?
body: <p>In JS, how can I get the mouse coordinates inside a DIV? if I use event.pageX, it will only work if the DIV is at the top left corner of the page... otherwise, I have to know the position of the DIV in the page and subtract event.pageX from that. This is hard to do when I generate the DIVs dynamically since I have to keep track of the position of each DIV. Any ideas?</p>
  
  <hr>
  
  <p>It seems like event.layerX and event.layerY works find in FF if I define the DIV with an absolute position. Here is a short example:</p>
  
  <p><a href="http://www.zangware.com/divpos.html" rel="nofollow noreferrer">http://www.zangware.com/divpos.html</a></p>
  
  <p>But in IE, event.layerX/Y is undefined inside the DIV. Any ideas?</p>