Jan
Jan

Reputation: 10068

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 have a higher priority, the form attributes or the input attributes?

Upvotes: 2

Views: 491

Answers (3)

Rob
Rob

Reputation: 6891

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.

Upvotes: 1

Fenton
Fenton

Reputation: 251262

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".

Upvotes: 2

melhosseiny
melhosseiny

Reputation: 10154

novalidate turns off HTML5 form validation for a form, that is, a required input field in that form won't be validated on submission.

Upvotes: 1

Related Questions