HTML5的必填项标签以及Email验证的设置

常用教程1 4,284阅读模式

设置一个Email并做验证,在HTML5中,只需要设置type类型为email就可以了。文章源自原紫番博客-https://www.yuanzifan.com/54579.html

如果需要设置为必填,则增加一个必填属性required。文章源自原紫番博客-https://www.yuanzifan.com/54579.html

其中,提示信息如果没有设置,则调用系统默认信息。根据浏览器的语言,提示固定的内容。文章源自原紫番博客-https://www.yuanzifan.com/54579.html

如果想要修改提示信息,则要进行代码属性的调整和修改。文章源自原紫番博客-https://www.yuanzifan.com/54579.html

如下:文章源自原紫番博客-https://www.yuanzifan.com/54579.html

<input type="email" name="emailaddr" required>
文章源自原紫番博客-https://www.yuanzifan.com/54579.html文章源自原紫番博客-https://www.yuanzifan.com/54579.html
 
    • 头条新闻 2

      文章不错支持一下吧

    发表评论

    匿名网友
    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
    确定

    取消

    拖动滑块以完成验证