title: Remove onclick event from img tag
body: <p>Heres my code:</p>
  
  <pre><code>&lt;div id="cmdt_1_1d" class="dt_state1" onclick="sel_test(this.id)"&gt;
  &lt;img id="cmdt_1_1i" onclick="dropit('cmdt_1_1');" src="/site/hitechpackaging/images/items/bags_menu.jpg "&gt;
  &lt;span class="dt_link"&gt;
  &lt;a href="javascript://"&gt;BAGS&lt;/a&gt;
  &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Unfortunately I cannot modify this file, is there a way using javascript to disable the onclick from the img tag only.</p>
  
  <p>I was using this script but it disable the onclick event from all images. But i want only from this component</p>
  
  <pre><code>var anchorElements = document.getElementsByTagName('img');
  // for (var i in anchorElements)
   //   anchorElements[i].onclick = function() {
         // alert(this.id);
   //       return false;
   //   }
  </code></pre>
  
  <p>Any ideas will be appreciated.</p>
  
  <p>Edited:
  Is there a way to stop the function dropit from executing, is it possible using javascript. On page load, etc. </p>
  
  <p>another option is can i rename the img file using javascript??</p>