Scroll to top

How to Prevent negative inputs in form input type=“number”?

Prevent negative inputs in form input type=“number”?


<html>
<body>
<form action=”#”>
  <input type=”number” name=”test” min=0 oninput=”validity.valid||(value=”);”><br>
  <input type=”submit” value=”Submit”>
</form>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *