Reputation: 381
I would like to make my website work identically on every browser. Unfortunately, the validation mechanism introduced their differences.
Field of type 'e-mail' on Chrome and Opera 'trim';delete blank spaces on input of e-mail field and Firefox no cuts signs and do not accept e-mail in this form.
<input type="email" id="e-mail" class="" name="e-mail" value="" placeholder="" autocomplete="off">
Example:
Upvotes: 0
Views: 458
Reputation: 6758
If you want to get the same behavior between browsers while keeping the email verification, you can trim the field on blur:
document.getElementById("e-mail").addEventListener("blur",function(e){
this.value = this.value.trim();
});
<input type="email" id="e-mail" class="" name="e-mail" value="" placeholder="" autocomplete="off">
Upvotes: 2