使用Html5的属性进行表单验证

<input id="name" name="name" placeholder="name" required="" tabindex="1" type="text"> 
<input id="email" name="email" placeholder="telephone" required="" tabindex="2" type="text" pattern="(^(\d{3,4}-)?\d{7,8})$|^(13|15|18|14)\d{9}$"> 
<input id="subject" name="subject" placeholder="example@domain.com" required="" tabindex="2" type="text"> 


// 主要用了HTML的一下属性
// 1.placeholder 提供可描述输入字段预期值的提示信息。 该提示会在输入字段为空时显示,并会在字段获
//得焦点时消失

//2.required 属性规定必需在提交之前填写输入字段

//3.pattern  是正则表达式,  里面可以直接填写正则表达式


编程技巧