简体   繁体   English

当在HTML输入字段中使用电子邮件类型输入空格时,Chrome无法触发onchange事件

[英]Chrome not firing onchange event when entering a space on HTML input field with type email

I was wondering if anyone can reproduce the following issue. 我想知道是否有人可以重现以下问题。

This was tested in Chrome 38.0.2125.101 beta-m 已在Chrome 38.0.2125.101 beta-m中进行了测试

When I enter a space in a regular <input type="text"> field, the onchange event is fired. 当我在常规的<input type="text">字段中<input type="text"> 空格时 ,会触发onchange事件。 With an <input type="email"> though, the onchange event does not fire. 但是,使用<input type="email"> ,不会触发onchange事件。

Jsfiddle: http://jsfiddle.net/L8j2hmme/ Jsfiddle: http : //jsfiddle.net/L8j2hmme/

Any ideas? 有任何想法吗?

It works fine for me but action is fired with delay and when multiple spaces are typed.Also whitespace is not valid character 它对我来说很好用,但是动作被延迟触发并且键入多个空格时,空格也是无效字符

<input type="email" name="email" id="email" />


function _x(elem){
   return document.getElementById(elem);
}

var x = _x("email");

x.onchange = function(){
 console.log(1);
}

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM