<script> window.onload = function() { document.getElementById("sel").onkeypress = function(e) { var e = e || event; if (e.keyCode == 38 || e.keyCode == 40) { alert(this.value); } } } </script> <select id="sel" multiple size="5"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select>