如何用Javascript编写文本更改事件 [英] How to write a Text Changed Event in Javascript

查看:66
本文介绍了如何用Javascript编写文本更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML文本框,它有一个textchange事件,但是问题是只有当焦点从文本框移开时才会触发.

是否有任何类似于TextChanged的javascript事件在将字符键入文本框中时(而不是在焦点更改时)立即触发?


请帮帮我.


谢谢

Dileep

I''ve a Html TextBox, and its having a textchange event , but the Problem is it only fires when focus is taken away from the textbox.

Is there any javascript event similar to TextChanged that fires immediately when a character is typed into the textbox, rather than when focus changes?


Please Help Me.


Thanks

Dileep

推荐答案

您可以使用 onkeypress [ ^ ]事件
这是一个示例 [
You can use the onkeypress [^]event
Here is a sample[^]


这篇关于如何用Javascript编写文本更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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