Create input accept numbers only

Hello!

I am new to P5js, trying to work with DOM library to accept number as user input. Is there a way to restrict the input box to accept numbers only as input?

i play with “input” and try this:
https://editor.p5js.org/kll/sketches/6ggb0_7uY

close to what you need?

https://Developer.Mozilla.org/en-US/docs/Web/HTML/Element/input/text#Specifying_a_pattern