html change 事件_html/css_WEB-ITnose

WBOY
发布: 2016-06-21 09:13:25
原创
1509 人浏览过

The change event is fired for 

事件在元素input,select,textarea的内容由用户改变的时候触发,并且不像input事件每一次的改变都触发。

Description

Depending on the kind of form element being changed and the way the user interacts with the element, the change event fires at a different moment:

When the element is activated (by clicking or using the keyboard) for  and ;

When the user commits the change explicitly (e.g. by selecting a value from a , by selecting a file in the file picker for , etc.);

When the element loses focus after its value was changed, but not commited (e.g. after editing the value of 

Different browsers do not always agree whether a change event should be fired for certain types of interaction. For example, keyboard navigation in  (see bug 126379).

描述

事件触发依赖于元素类型,触发方式以及触发不同时刻,如下所示

对于,元素激活时触发(通过点击或者键盘)

用户明确提交更改(例如,鼠标点击选取select,从 选取日期,从选取文件)

元素失去焦点时内容以改变,但并未提交(例如 

不同的游览器不保证特定类型的交互触发change事件。例如,在Gecko,除非用户点击enter或者从


引用:https://developer.mozilla.org/en-US/docs/Web/Events/change


**

怪不得很多change事件和预想的不一样。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!