$.html5Validate.isAllpass简单应用示意实例页面
回到相关文章 »代码:
HTML代码:
<p><strong>订阅优惠信息</strong></p> <input type="email " class="email" placeholder="输入邮箱,如a@b.com" required /> <p><a href="javascript:" class="button">订阅</a></p>
JS代码:
$(".button").bind("click", function() { var email = $(".email"); if ($.html5Validate.isAllpass(email)) { alert("订阅成功!"); email.val(""); } });
效果:
订阅优惠信息