Use the onkeyup event instead