Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 HTML5 中,您可以使用输入模式,当输入错误或必需但为空时,您会在该字段上获得特定于浏览器的工具提示。我想知道我是否可以玩它。例如,我可以使用无法使用模式完成的自定义客户端验证。有什么我可以触发的事件吗?
您可以通过 JS 将模式属性更改为不可能匹配,因此它总是“失败”,导致它显示工具提示。就像是a{99999999999}
a{99999999999}
我很想知道这是一种什么样的验证,尽管这不能用正则表达式来完成。