JSFiddle - React, Tailwind, and code Playground
by steveukx
CSS
html, body {
height: 100%;
color: #333;
font-family: arial;
}
JavaScript
alert(typeof document.body.ontouchstart);
document.body.addEventListener('touchstart', function() {
var newDiv = document.createElement('div');
newDiv.innerHTML = 'touch start';
document.body.appendChild(newDiv);
}, false);
document.body.addEventListener('tap', function() {
var newDiv = document.createElement('div');
newDiv.innerHTML = 'tap';
document.body.appendChild(newDiv);
}, false);
document.body.addEventListener('touchmove', function() {
var newDiv = document.createElement('div');
newDiv.innerHTML = 'touchmove';
document.body.appendChild(newDiv);
}, false);
document.body.addEventListener('click', function() {
var newDiv = document.createElement('div');
newDiv.innerHTML = 'click';
document.body.appendChild(newDiv);
}, false);