Jquery is a perfect way to listen to changes in input box values in real time (mandatory ).
You only need to bind the oninput and onpropertychange events at the same time, but this is not perfect.
$ ('. Input-form: input '). bind ('input propertychang', function () {// get. all <input> elements in input-form, and real-time listening to user input // logic })
The above Code uses bind, so when a new input tag is appended, it cannot be listened.
The following scenarios:
We can see that the numbers 189 and 135 can be monitored, but the newly appended numbers 178 and 188 are invalid.
How can this problem be solved?
It's been a long time. Okay, use live instead of bind.
$ ('. Input-form: input '). live ('input propertychang', function () {// get. all <input> elements in input-form, and real-time listening to user input // logic })
The perfect way for jquery to listen to the value changes in the input box in real time (mandatory) is all the content shared by Alibaba Cloud. I hope you can provide a reference and support for the customer.