Imagine this piece of html:
<form>
<input type="text">
<input type="submit" id="a">
</form>
and this piece of Javascript
document.getElementById('a').onclick = function (e) {
alert(e.type);
};
The alert will always say 'click', even if you press enter in the textfield.
How can I check if the button is really clicked?