DOM Properties

ValidityState.stepMismatch

True when a value does not align with the allowed step grid. The step base depends on min, the value attribute or type default; step="any" disables this restriction. Example result: true.

Formal Syntax & Structure

html syntaxhtml
input.validity.stepMismatch

Return Value

boolean

Read-only constraint flag.

Working Example

Example Snippethtml
<input type="number" min="0" step="2" value="3" aria-label="Quantity"><p>  Result:  <output id="result"></output></p><script>  const result = document.getElementById("result");  (async () => {  const input = document.querySelector("input");  result.textContent = input.validity.stepMismatch;  })().catch(error => { result.textContent = "Error: " + error.name; });</script>
HTML Reference