title: Javascript click event on mobile
body: <p>I have a Javascript function that works fine on PC, but it doesn't work when loaded on mobile. I think it is because mobile treats tap and click differently, but how do I modify the following function so that it works on mobile? </p>
  
  <pre><code>(function () {
      var a = { 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9", 106: "x", 107: "+", 109: "-", 110: ".", 111: "\u00f7", 8: "backspace", 13: "=", 46: "c", 67: "c" }, b = function (b) {
          if (b.keyCode in a) {
              var c = document.getElementById("button-" + a[b.keyCode]);
              c.className.match(/(\s|^)active(\s|$)/) || (c.className += " active");
              setTimeout(function () {
                  c.className.match(/(\s|^)active(\s|$)/) &amp;&amp; (c.className = c.className.replace(/(\s|^)active(\s|$)/, " "))
              }, 100);
              document.createEvent ? (b = document.createEvent("HTMLEvents"), b.initEvent("click", !0, !0), c.dispatchEvent(b)) : (b = document.createEventObject(), c.fireEvent("onclick", b))
          }
      };
      document.addEventListener ? document.addEventListener("keyup", b, !1) : document.attachEvent &amp;&amp; document.attachEvent("keyup", b)
  })();
  </code></pre>