【HTML5】使用正则表达式构造定制的输入框

2015-09-14 0 133
【HTML5】使用正则表达式构造定制的输入框
<!DOCTYPE html>
 
<html>
 
<head>
 
<title>
</title>
 
</head>
 
<body>
 
<form id="myForm">
 
<fieldset>
 
<legend>Solution 4-8: Creating custom input types using regular expressions</legend>
 
<label> Insert a valid American Zip code:
 
<input type="text" name="ssn"
 
pattern="(\d{5}([\-]\d{4})?)"
 
title="Zip Code" />
 
</label>
 
<p><input type="submit" value="Check Zip code" /> </p>
 
</fieldset>
 
</form>
 
</body>
 
</html>

遇见资源网 html 【HTML5】使用正则表达式构造定制的输入框 http://www.ox520.com/14411.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务