JSFiddle - React, Tailwind, and code Playground

by yuezhizizhang

HTML

<h3>Detect whether it's a mobile OS:</h3>
<h2 id="device"></h2>

JavaScript

$(function() {
	var touch = 'createTouch' in document,
		text = touch ? 'Touch Device' : 'Desktop Device';

	$('#device').html(text);
});