实例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <form> <!--文本框:<input type="text" id="" value="" placeholder="" autofocus autocomplete="on" name="user"/><br> 密码框:<input type="password" id="" value="" required/><br> 数字框:<input type="number" id="" value="" /><br>--> <!------------------------------------------------------> <!--密码框:<input type="text" id="" value="" pattern="^[a-z0-9_-]{6,18}$"/><br>--> <!--电话框:<input type="tel" pattern="[0-9]{7,12}"/>--> <!--文本框:<input type="text" id="" value="" maxlength='8'/><br>--> <!--输入的数字必须是8以下,3以上--> <!--数字框:<input type="number" id="" value="" min="3" max="8" />--> 区域:<input type="range" id="" value="" min="0" max="100" step="10"/> <input type="submit" value="提交"/> </form> </body> </html>