require button element to have a valid type (button-type)

HTML button defaults to type="submit" when attribute is missing or invalid which may not be the intended type.

Rule details

Examples of incorrect code for this rule:

<!-- missing type -->
<button>...</button>

<!-- invalid type -->
<button type="foo">...</button>
2:2 - Button is missing type attribute
5:9 - Button has invalid type "foo"

Examples of correct code for this rule:

<button type="button">...</button>