var supportsTouch = ('ontouchstart' in document.documentElement);
<html> <head><title>Сенсорный экран или Мышь?</title></head> <body> <div id='test' onmousemove='GetPad(event);' onclick='if(IsPad == true) Show2(); else Show1(); '>ТКНИ СЮДА</div> <script type='text/javascript'> x1=0;x2=0;x3=0;y1=0;y2=0;y3=0;IsPad = true; function GetPad(ev) { if (document.all) {//IE x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft; y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop; x += window.event.clientX; y += window.event.clientY; } else {//Good Browsers x = ev.pageX; y = ev.pageY; } x1=x2;x2=x3;x3=x; y1=y2;y2=y3;y3=y; if(x1>0 && x2>0 && x3>0 && y1>0 && y2>0 && y3>0) IsPad = false; } function Show1(){ x1=0;x2=0;x3=0;y1=0;y2=0;y3=0;IsPad = true; document.getElementById("test").innerHTML="МЫШЬ";} function Show2(){ x1=0;x2=0;x3=0;y1=0;y2=0;y3=0;IsPad = true; document.getElementById("test").innerHTML="СЕНСОР";} </script> </body> </html>