亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

ie9RC版兼容性

ie9RC版兼容性

慕碼人8056858 2018-12-07 07:05:51
<html xmlns="http://www.w3.org/1999/xhtml"><head>??? <title></title>??? <script type="text/javascript">??????? function add() {??????????? var inputs = document.getElementsByTagName("input");??????????? for (var i = 0; i < inputs.length; i++) {??????????????? var input = inputs[i];??????????????? input.onkeydown = function () {//??????????????????? alert(window.event.keyCode); //按回車顯示為13//??????????????????? alert(window.event.keyCode == 13);//顯示為true??????????????????? if (window.event.keyCode == 13) {??????????????????????? ??????????????????????? window.event.keyCode = 9;//??????????????????????? alert(window.event.keyCode);//顯示為9??????????????????? }??????????????? };??????????? }??????? } ??? </script></head><body? onload="add()">??? <input id="Text1" type="text" />??? <input id="Text2" type="text" />??? <input id="Text4" type="text" />??? <input id="Text3" type="text" />??? <input id="Text5" type="text" /></body></html> 在IE8上測試正常,在IE9上無反應,不知道如何解決
查看完整描述

1 回答

?
森欄

TA貢獻1810條經驗 獲得超5個贊

input.onkeydown = function(e) {

??e = e|| window.event;

??//用e來代替window.event
}

查看完整回答
反對 回復 2018-12-24
  • 1 回答
  • 0 關注
  • 488 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號