jQuery监听所有文本输入更改 [英] jQuery Listen For All Text Input Changes

查看:134
本文介绍了jQuery监听所有文本输入更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单中的一个输入元素,我希望能够在值更改时提取其值。看看这个小提琴: http://jsfiddle.net/spryno724/WaBzW/1/

I have an input element within a form which I would like to be able to extract its value when the value changes. Take a look at this Fiddle: http://jsfiddle.net/spryno724/WaBzW/1/.

通过使用更改事件,我可以在输入时显示文本输入中的值失去了重点。但是,当表单重置或JavaScript清除文本输入的值时,该值不会更新。

By using the change event, I am able to display the value from the text input when the input looses focus. However, the value does not update when the form is reset or when JavaScript clears the value of the text input.

是否有一个特定的事件,我可以听哪些当 更改文本输入控件时,将被调度?

Is there a specific event that I can listen for which will be dispatched when any change is made to a text input control?

我想避免解决方法,例如在窗体复位时侦听,或者当按下清除按钮时。这是我应用程序的简化示例,如果我尝试完成所有这些操作,它会快速疯狂。

I'd like to avoid work-arounds, such as listening for when the form is reset, or when the clear button is pressed. This is a simplified example of what my application does, and it will get crazy pretty fast if I try to do all of that.

谢谢你的时间。 p>

Thank you for your time.

推荐答案

这个问题与另一个问题完全相同。看到最高票数最多的答案是我的问题的答案:

This question is an exact duplicate of another. See the answer with the highest number of up-votes as the answer to my question:

JS事件:挂起文本输入上的值更改事件

这篇关于jQuery监听所有文本输入更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆