<input type="text" name="someInput" required> <input type="text" name="someInput" required="required">
有了这个属性,使表单的提交验证变得更简单了,看看下面简单的例子:
<FORM method=post> <LABEL for=someInput> Your Name: </LABEL> <INPUT id=someInput type=text name=someInput placeholder="Douglas Quaid" required="required"> <BUTTON type=submit>Go</BUTTON> </FORM>如果输入框为空,表单将无法提交成功。