efficientified onkeyup and onkeydown