Is there a way to make an input only accept one letter in HTML?

332 views Asked by At

I'm working on an Wordle remake in HTML, and I want to make separate inputs for each letter, but I don't know how to make the input only accept one letter. Is there any way to make an input only accept one letter?

1

There are 1 answers

2
HaukurHaf On BEST ANSWER

Sure you can. Using the maxlength attribute.

<input type="text" maxlength="1">