Home  >  Q&A  >  body text

javascript - js plug-in, question about input box placeholder

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?

给我你的怀抱给我你的怀抱2684 days ago780

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-07-05 11:05:40

    Onfocus event modifies the value of the input.
    input type=number restricts input to numbers only

    reply
    0
  • 某草草

    某草草2017-07-05 11:05:40

    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.

    reply
    0
  • Cancelreply