Answers for "what is the best way of telling if a device is touch enabled in vanilla js"

3

javascript detect touch screen

function isTouchScreendevice() {
    return 'ontouchstart' in window || navigator.maxTouchPoints;      
};

if(isTouchScreendevice()){
    alert("I am a touch screen device")
}
Posted by: Guest on August-05-2019

Code answers related to "what is the best way of telling if a device is touch enabled in vanilla js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language