JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test"> TEST </div>
CSS
::selection { background:transparent; }
::-moz-selection { background:transparent; }
#test { cursor:default; }
JavaScript
function universal_action_handler ( e ) {
var target, style;
e = e || window.event;
target = e.target || e.srcElement;
style = target.style;
if ( e.type === 'click' ) {
style.fontSize = 'larger';
} else {
style.backgroundColor = ( e.type === 'mouseover' ) ? 'red' : 'transparent';
style.fontSize = '';
}
}
var div = document.getElementById( 'test' );
div.onclick = div.onmouseover = div.onmouseout = universal_action_handler;