HTML: <form id="validateForm" action="javascript:show_ok()"> <p>Enter a date: <input type="date" name="day" required="required" title="Use format yyyy-mm-dd" /></p> <p>Enter a US ZIP Code or Canadian Postal Code: <input type="text" name="postCode" required="required" pattern="([0-9]{5}(-[0-9]{4})?)|([A-Z][0-9][A-Z]\s+[0-9][A-Z][0-9])" title="US: 99999-1234; Canadian: A1B 2C3" /></p> <p><input type="submit" value="Check Data" /> <span id="ok" class="ok" style="display:none;"> Valid Data! </span></p> </form> 这样的表单就很吸引。