title: Trying to add an attribute to all images
body: <p>I'm not understanding what I am doing wrong, this is supposed to add contextmenu attribute to images to return false. I tried 'img[i].contextmenu="return false";' too.</p>
  
  <pre><code>var img = document.body.getElementsByTagName("img");
  var i = 0;
  while (i &lt; img.length) {
      img[i].setAttribute("contextmenu", "return false;");
      i++;
  }
  </code></pre>
  
  <p>I'm basically wanting to turn this jQuery into JavaScript:</p>
  
  <pre><code>$(document).ready(function() {
      $("img").bind("contextmenu", function(e) {
          return false;
      });
  });
  </code></pre>