Detect touch devices
function hasTouchScreen() {
return ('ontouchstart' in window) ||
window.DocumentTouch &&
document instanceof DocumentTouch;
}
Written by Caleb W
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mobile
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#