HTML5内置邮箱验证属性

只需给提交的表单(邮箱)添加只需要type=“email”即可。

例:

<form action="" method="post">
    <label for="email">邮箱:</label><input id="email" name="email" type="email" /> 
    <button type="submit">确定</button>
</form>

demo:

原文地址:https://www.cnblogs.com/zhru/p/3812198.html