posted on Sunday, June 13, 2004 3:42 AM by leon

Difference between IMG and INPUT type="image" DHTML elements

Just bumped again into <IMG …> against <INPUT type="image" …> differences question.

So here we go:

<INPUT type="image" …> creates DHTML control that in addition to all his events, when clicked, causes the form to be immediately submitted (just like <INPUT type="submit" …>). One confusing thing is that this control will receive "onclick" event on every enter user presses.

Conclusion: if you want pure client side processing, <IMG …> element is your natural choice

Comments