HTML5 attribute priority
Html5 has new attributes like the novalidation attribute for the form element and the required element for an input element.
When using both of this type of attributes, what sort of attribute 开发者_Python百科have a higher priority, the form attributes or the input attributes?
The novalidate attribute specifies that the form should not be validated when submitted. If this attribute is present the form will not validate form input. (source: http://www.w3schools.com/html5/att_form_novalidate.asp)
This means it won't validate required input items, the format of email and url input types and so on. It essentially means "allow any input".
novalidate
turns off HTML5 form validation for a form, that is, a required
input field in that form won't be validated on submission.
Judging by the information from w3schools here and the working example here I would say that the novalidate attribute always overrules form-elements, even when they have the required attribute.
精彩评论