<input type="number" min="1" max="5" value="10" required/> input:invalid { background-color: purple; }