项目需求中有时候需要实时监测 input 的值变化,虽然 input 自身有 focus 和 blur 事件,但是有时候跟需求不符合。

所以实时监听 input 值变化的代码为:

$("#inputId").bind("input propertychange",function(event){
  console.log($("#inputId").val())
});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-26
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案