jquery 实时监听输入框值变化方法

$('.offers-number').bind('input propertychange', function (a, b) {
  var value = $(this).val()
  if (!value || isNaN(value))
    $(this).removeClass("active").val("")
  else
    $(this).addClass("active")
  total()
});
原文地址:https://www.cnblogs.com/guanzelin/p/8717764.html