"oninput" event might be the simplest (also great for range inputs):
<input type="number" id="n" value="5" step=".5" oninput="alert(this.value);" />