title: Disable long press on smartphone
body: <p>I have already had a usable code for disabling long press
  but now I don't want to get element by ID. It's not possible for me to add Id for every particular items.
  I want to make it works for every img in a Name Tag.
  However, it's not working now. Please help.</p>
  
  <p>Original working line:
      preventLongPressMenu(document.getElementById('theimage'));</p>
  
  <p>Edited line:
      preventLongPressMenu(document.getElementByTagName('body img'));</p>
  
  <p>entire code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;script&gt;
      function absorbEvent_(event) {
        var e = event || window.event;
        e.preventDefault &amp;&amp; e.preventDefault();
        e.stopPropagation &amp;&amp; e.stopPropagation();
        e.cancelBubble = true;
        e.returnValue = false;
        return false;
      }
  
      function preventLongPressMenu(node) {
        node.ontouchstart = absorbEvent_;
        node.ontouchmove = absorbEvent_;
        node.ontouchend = absorbEvent_;
        node.ontouchcancel = absorbEvent_;
      }
  
      function init() {
        preventLongPressMenu(document.getElementByTagName('body img'));
      }
    &lt;/script&gt;
    &lt;style&gt;
      *:not(input):not(textarea) {
      -webkit-user-select: none; /* disable selection/Copy of UIWebView */
          -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
  
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body onload="init()" id="theimage" &gt;
    &lt;img src="http://www.google.com/logos/arthurboyd2010-hp.jpg" width="400"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>