I was trying to restrict input type="number"(html) to only integers numbers, and I found this solution:
<input id="test" type="number" min="1" step="1" oninput="validity.valid||
(value='');">
Can anyone tell me how can i do this in js code oninput="validity.valid||(value='')