How do I implement onchange of <input type=“text”> with jQuery?

后端 未结 14 1113
[愿得一人]
[愿得一人] 2020-11-27 10:15

?

14条回答
  •  执念已碎
    2020-11-27 11:10

    You could use .keypress().

    For example, consider the HTML:

    Trigger the handler

    The event handler can be bound to the input field:

    $("#target").keypress(function() {
      alert("Handler for .keypress() called.");
    });
    

    I totally agree with Andy; all depends on how you want it to work.

提交回复
热议问题