onChange事件不起作用 [英] onChange event not working

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

问题描述

我尝试了许多发现的不同方法,但似乎无法正常工作.我有一个名为name的文本输入框,并且尝试使用onChange ="function".在输入声明中,我尝试了name.onChange = function,attacheventlistener和attachevent.我似乎无法使这个工作.我最接近的是该功能在我启动页面时运行正确,但是再也没有运行过.

I have tried as many different methods as I have found but I can not seem to get this working. I have a text input box called name and I have tried onChange="function" in the input declaration, I've tried name.onChange = function, attacheventlistener and attachevent. I can not seem to get this working. The closest I have came is the function running right when I start the page but never running again. Any help would be appreciated.

推荐答案

尝试"onchange";反而. Javascript事件通常以小写形式命名所有内容,而不是像您期望的那样使用骆驼框.
Try "onchange" instead.  Javascript events generally name everything in full lower-case, rather than camel-casing like you would expect.


这篇关于onChange事件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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