Home > front end >  Strives for the bosses
Strives for the bosses

Time:10-11

How do you write in js to limit can only allow the user to enter an odd number

CodePudding user response:

To input binding keypress events, determine the input character is odd, can use a regular, does not meet the conditions, the event. The preventDefault ()

CodePudding user response:

reference 1st floor weixin_45981953 response:
to input binding keypress events, determine the input character is odd, can use a regular, does not meet the conditions, the event. The preventDefault ()
I reconsideration
  • Related