JSFiddle - React, Tailwind, and code Playground
HTML
<div id="touchground">click me, touch me, move me</div>
<div id="console"></div>
CSS
#touchground {
border: 5px solid blue;
background-color: #ffa;
padding: 10px;
}
#console:before {
content: "Events:";
clear: both;
display: block;
}
#console {
border: 1px solid #aaa;
padding: 5px;
}
JavaScript
var $console = jQuery('#console');
var watched_events = ['click', 'mouseover', 'mousedown', 'mouseenter', 'mouseout', 'mouseleave', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'gesturestart', 'gesturechange', 'gestureend'];
jQuery('#touchground').on(watched_events.join(' '), function(event){
$console.prepend('Fired event: ' + event.type + '<br />');
});