Remove onclick event from img tag
Here is my code:
<div id="cmdt_1_1d" class="dt_state1" onclick="sel_test(this.id)">
<img id="cmdt_1_1i" onclick="dropit('cmdt_1_1');" src="/site/hitechpackaging/images/items/bags_menu.jpg ">
<span class="dt_link">
<a href="javascript://">BAGS</a>
</span>
</div>
Unfortunately, I cannot change this file, is there any way to use javascript to disable onclick only from the img tag.
I used this script but disconnected the onclick event from all the images. But I want only from this component
var anchorElements = document.getElementsByTagName('img');
// for (var i in anchorElements)
// anchorElements[i].onclick = function() {
// alert(this.id);
// return false;
// }
Any ideas would be appreciated.
Edited: Is there a way to stop the dropit function from executing, is it possible to use javascript. On page loading, etc.
Another option: can I rename the img file using javascript ??
+5