📌  相关文章
📜  按下输入键时javascript提交表单 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:07.482000             🧑  作者: Mango

代码示例1
//submit form when 'Enter' key is pressed while in myInputID
document.getElementById("myInputID").addEventListener("keyup", function(event) {
    if (event.keyCode === 13) {
        document.getElementById("myFormID").submit();
        return false;
    }
});