1. var testEl = document.getElementById("el");
  2. testEl.onmousedown = function () {
  3. // initialize mouse interface
  4. }
  5. testEl.ontouchstart = function () {
  6. testEl.onmousedown = null; // initialize touch interface
  7. }