JSFiddle - React, Tailwind, and code Playground

by dying_sakura

HTML

<input type="number" min="0" max="9000" step="5" id='inputnumber' />

CSS

:invalid {
    background: red;
}

JavaScript

const input = document.getElementById('inputnumber');
input.addEventListener('change', () => {
  if(input.value % 5 !== 0){
    alert('not valid');
    input.value = 5;
  }
});