简体   繁体   English

Jquery:我如何跟踪输入元素的变化?

[英]Jquery: How can i track changes in input elements?

I need to track changes on an input element but this should be done whenever anything change its value, not only users typing. 我需要跟踪输入元素的更改,但是只要有任何更改值,就应该这样做,而不仅仅是用户输入。

The keyup event is not what i need as already specified and the change event only works when the input loses focus. keyup事件不是我已经指定的,并且change事件仅在输入失去焦点时才起作用。

Any ideas of how can i do this? 我怎么能这样做的想法?

In non-IE browsers, you can handle the input event. 在非IE浏览器中,您可以处理input事件。
In IE, you can handle the propertychange event. 在IE中,您可以处理propertychange事件。

Demo (works in all browsers) 演示 (适用于所有浏览器)

你能不能只为“改变”,“粘贴”和“剪切”事件绑定处理程序,以及“按键”或“键盘”?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用匹配所有元素的jQuery选择器跟踪多个元素的点击计数? - How can I track click counts for multiple elements with a jQuery selector that matches all of the elements? 跟踪大型输入形式中的更改的最快方法(Javascript / jQuery) - Fastest (Javascript/jQuery) way to track changes in a large input form 如何跟踪页面上特定元素子集的点击以跟踪每个项目的受欢迎程度? - How can I keep track of clicks on a specific subset of elements on a page to track each items popularity? 当隐藏的输入框的文本由外部jquery更改时,如何触发函数? - How can I trigger a function when the text of a hidden input box changes by an external jquery? 如何取消设置 jquery 所做的更改? - How can i unset the changes made by jquery? 如何跟踪对Javascript的更改? - How do I track changes to my Javascript? 如何获取可更改元素的最新 HTML 标签,例如 JS/Jquery 中的 Select、Checkbox、Input? - How can I get the latest HTML tags of a changeable elements, like Select, Checkbox, Input in JS/Jquery? 如何实现复选框的属性以在不使用Grid对象或jQuery.Data(Input)的情况下跟踪表中每一行的更改? - How to implement properties of checkbox to keep track of your changes on each line in your table without employing Grid object or jQuery.Data(Input)? 我可以只覆盖一些输入元素的jQuery .val()吗? - Can I override jQuery .val() for only some input elements? 如何处理jQuery中数字输入的更改? - How do I handle number input changes in jQuery?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM