我正在文本区域和文本字段上的inputmode属性获得验证错误.验证器告诉我此时不允许元素输入使用Attribute inputmode,但是
the HTML5 spec indicates that it is allowed.
这段代码实际上有什么问题,还是验证器有错?
这是一个裸机的情况,它会产生这种验证错误(两次),一种是电子邮件输入,另一种是textarea.
<!DOCTYPE HTML> <html lang="en"> <head> <Meta charset="utf-8"> </head> <body> <form method="post" action="contactme.PHP"> <label class='pas block'> Your E-Mail:<br/> <input type='email' name='email' required inputmode='latin' placeholder='your e-mail here' /> </label> <label class='pas block'> Your Message:<br/> <textarea name='message' required inputmode='latin' placeholder='and your message here!'></textarea> </label> </form> </body> </html>
解决方法
HTML5规范说
The following content attributes must not be specified and do not apply to the element: accept,alt,checked,dirname,formaction,formenctype,formmethod,formnovalidate,formtarget,height,inputmode,max,min,src,step,and width.