JSFiddle - React, Tailwind, and code Playground
by Dan Pasca
HTML
<div class='wt'></div>
<button class='clear'>Clear</p>
CSS
.wt {
width: 300px;
height: 300px;
background: aqua;
}
.wtfixedpoint {
width: 5px;
height: 5px;
position: fixed;
background: black;
z-index:20;
}
JavaScript
console.clear();
$(document).ready(function() {
$('.wt').on('mousemove', function(event) {
$('.wt').append('<div class=wtfixedpoint style=left:' + event.pageX + 'px;top:' + event.pageY + 'px;></div>');
});
$('.clear').on('click', function(event) {
event.preventDefault();
$('.wt').empty();
});
});