我寫了這段代碼,只有點擊事件正在工作,但關鍵事件沒有。任何人都可以向我解釋爲什麼?在點擊或當輸入鍵被按下時觸發事件[JavaScript]
Btn_List.addEventListener("keypress", function(e) {
\t var key = e.keyCode();
\t if (key === 13) {
\t \t function OnKeyEnterPressDoThis() {
\t \t \t Input_Tarea();
\t \t \t showTheNmbrOfListElmts();
\t \t \t orderAlphaFukkabossList();
\t \t }
\t }
});
// Agregar Tarea
Btn_List.addEventListener("click", function() {
\t Input_Tarea();
\t showTheNmbrOfListElmts();
\t orderAlphaFukkabossList();
});
o my ... god deam works XD:writted.addEventListener(「keypress」,function(e){ var key = e.keyCode; (key === 13) Input_Tarea(); showTheNmbrOfListElmts(); AlphabeticOrderInTheList(); } },false); –