?document.onkeydown=function(){
????????if?(event.keyCode==40){
????????????as[index].style.backgroundColor="#fff";
????????????if(index==4){
????????????????index=0;
????????????}
????????????else{
????????????????index++;
????????????}
????????}
????????if?(event.keyCode==38){
????????????as[index].style.backgroundColor="#fff";
????????????if(index>0){
????????????????index--
????????????}
????????????else{
????????????????index=as.length-1;
????????????}
????????}
????????as[index].style.backgroundColor="#456";
????}
2018-03-04
2018-03-04
對了你還有個參數沒寫 ? ? event
2018-03-04
這次試過了 ?
這一句 ?as[index].style.backgroundColor="#fff";
還有你的判斷 ?
2018-03-04
這樣試試