var testEl = document.getElementById("el"); testEl.onmousedown = function () { // initialize mouse interface } testEl.ontouchstart = function () { testEl.onmousedown = null; // initialize touch interface }