您好,欢迎访问一九零五行业门户网

html中input框的pattern属性解析

定义和用法
pattern 属性规定用于验证输入字段的模式。
模式指的是正则表达式。您可以在我们的 javascript 教程中阅读到这方面的内容。
注释:pattern 属性适用于以下 d5fd7aea971a85678ba271703566ebfd 类型:text, search, url, telephone, email 以及 password 。
提示:请使用标准的 title 属性来描述模式。
语法:
<input pattern="regexp">
例子:
<!doctype html> <html> <body> <form action="/example/html5/demo_form.asp" method="get">
国家代码:
<input type="text" name="country_code" pattern="[a-z]{3}" title="三个字母的国家代码" /> <input type="submit" /> </form> </body> </html>
以上就是html中input框的pattern属性解析的详细内容。
其它类似信息

推荐信息