As shown in the picture above, when focused, the input box will display a horizontal placeholder. Enter as many digits as the placeholder has, and if it is a phone number, you can limit the input to only numbers;
When lost When in focus, the placeholder value is displayed;
Question: Has anyone used a similar plug-in? What is the implementation principle?
Onfocus event modifies the value of the input.
input type=number restricts input to numbers only
When binding the input event to the input box, judge the content through regular expressions, and set the value of the input box in real time to prevent input if it is illegal. The placeholder may be a p simulation. I have never used this plug-in and it is purely a personal opinion.