#3 image-buttons

from blog HTMHell, | ↗ original
↗ original
Bad code img src="/images/edit.gif" onclick="openEditDialog(123)">img src="/images/delete.gif" onclick="openDeleteDialog(123)"> Issues and how to fix them The purpose of the img element is to display images, not to execute JavaScript. A click event on a img triggers only on click. A click event on a button triggers on click and if the user...