Is touchscreen on javascript

Categories: howto

Some of javascript shortcuts below here:

var is_touch_device = 'ontouchstart' in document.documentElement;
function isTouchDevice() {
    var el = document.createElement('div');
    el.setAttribute('ongesturestart', 'return;');
    return typeof el.ongesturestart === "function";

No webmentions were found.

Comment with Disqus

Comment with an Email

No comments here yet Write here gently

Comment with Talkyard

Comments powered by Talkyard.