JSFiddle - React, Tailwind, and code Playground

by winstonchang

HTML

<div id="target" style="width:300px; height:300px; background-color:#ddd">

</div>

JavaScript

const t = document.getElementById('target');
let prev_e = null;
let count = 0;
t.addEventListener('mousedown', e => {
	console.log(count++);
  if (prev_e)
  	console.log(prev_e);
  console.log(e);
  prev_e = e;
})