Event for SELECT onchange with keyboard

I have an onchange event in an HTML SELECT control that calls a JavaScript function. This works if I select a new option from the open list with the mouse or if I drop out the SELECT control and then select the option with the mouse or select using the keyboard and press ENTER.

How to make the function run if the SELECT control is NOT open, and I just scroll up or down with the cursor keys through various parameters. onblur does nothing, and onkeypress produces some weird results in which the values ​​go out of sync.

+8
javascript html onchange
source share
1 answer

The onkeyup event onkeyup resolve the following:

 <select name="theName" id="theID" onchange="javascript:theFunction();" onkeyup="javascript:theFunction();"> <option value="A">Choice A</option> <option value="B">Choice B</option> <option value="C">Choice C</option> </select> 
+5
source share

All Articles