javascript - How to set the first digit of the input box to not be zero
伊谢尔伦
伊谢尔伦 2017-05-19 10:25:22
0
3
879

How to set the first digit of the input input box to not be zero

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
世界只因有你

Listen to the oninput event, use regular expression to determine whether the first digit is zero, and reset the input box if it is zero

过去多啦不再A梦

Bind the input event of the input box, get the value of the input box, take the first character of the string, and determine whether it is equal to 0

淡淡烟草味
  1. Bind keyup event;

  2. Verify whether the content when the input content length is 1 is 0 (regular expressions can be used);

  3. Handling of different results.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!