JSFiddle - React, Tailwind, and code Playground

HTML

<div id="id_frame"></div>
<div id="id_spy"></div>

CSS

div {
  position: absolute;
  width: 300px;
  height: 300px;
}
#id_frame {
  background: #888888;
}

JavaScript

var frm = document.getElementById('id_frame');
var spy = document.getElementById('id_spy');

frm.onclick = function() {
	console.log('frm click');
}
spy.onclick = function() {
	console.log('spy click');
}
spy.onmousemove = function(e) {
	console.log('mm', e.pageX, e.pageY);
}

spy.style.display = 'none';

var counter = 0;

setInterval(function() {
	counter = (counter + 1) % 10;
  spy.style.display = counter ? 'none' : '';
}, 20);