title: Problem getting mouse coordinates of user with an iframe that has overlapping elements
body: <p>I have this code</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  iframe {
    width: 200px;
    height: 200px;
    
  }
  /* Playground by EThaiZone */
  #parent {
    width: 200px;
    height: 200px;
    border:solid 1px #000;
  }
  iframe {
    width:100%;
    height:100%;
    border:0px;
  }
  
  #parent &gt; button {
    opacity: 0.3;
    position:relative;
    float: right;
    right:10px;
    bottom:35px;
    transition: 0.5s;
  }
  #parent &gt; button {
    opacity: 1;
  }  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id=&quot;parent&quot;&gt;
    &lt;iframe src=&quot;get_mouse_info.html&quot;&gt;&lt;/iframe&gt;
    &lt;button&gt;Test Button&lt;/button&gt;
  &lt;/div&gt;
  &lt;/body&gt;&lt;/html&gt;
  
  </code></pre>
  <p>that contains an iframe loading another page (get_mouse_info.html) and a button that overlaps the iframe. My goal is to log the mouse coordinates of the user as they move their mouse anywhere on the iframe. My problem is that every time the user starts moving their mouse on the overlapping button, the iframe cannot pick up the user's mouse coordinates. This is the code for the mouse tracker</p>
  <p>get_mouse_info.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;style&gt;html, body {height: 100%;margin: 0;}&lt;/style&gt;&lt;/head&gt;
  &lt;body onmousemove=&quot;myFunction(event)&quot; style = 'background-color:transparent;'&gt;
  
  &lt;script&gt;
  function myFunction(e) {
    var x = e.clientX;
    var y = e.clientY;
    var coor = &quot;Coordinates: (&quot; + x + &quot;,&quot; + y + &quot;)&quot;;
    console.log(coor);
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>
  <p>Any help is appreciated. Thanks</p>
  <p>EDIT:
  Forgot to mention that I'd like to still be able to click the button afterward. 'pointer-events: none;' (or some similar method) might solve the coordinates problem but wouldn't suit my needs. Thanks</p>