当前位置: 代码迷 >> 综合 >> Trigger a button click with JavaScript on the Enter key in a text box
  详细解决方案

Trigger a button click with JavaScript on the Enter key in a text box

热度:31   发布时间:2023-12-15 12:53:40.0

In jQuery, this would work:

$("#id_of_textbox").keyup(function(event){
    if(event.keyCode == 13){
    $("#id_of_button").click();} });
  相关解决方案