<input type = "number">
<a href = "https://ya.ru/">Яндекс</a>
<form>
<input type = "text">
<input type = "submit">
</form>
<script>
document.onclick = function(e) {
if(e.target.type != 'submit') {
e.preventDefault();
alert( e.target.type);
}
}
</script>