How to make HTML input tag only accept numerical values? in jsx code example
Example: How to make HTML input tag only accept numerical values? in jsx
<input
onKeyPress={(event) => {
if (!/[0-9]/.test(event.key)) {
event.preventDefault();
}
}}
/>