How to set the first digit of the input input box to not be zero
小伙看你根骨奇佳,潜力无限,来学PHP伐。
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
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
Bind keyup event;
Verify whether the content when the input content length is 1 is 0 (regular expressions can be used);
Handling of different results.
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
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
Bind keyup event;
Verify whether the content when the input content length is 1 is 0 (regular expressions can be used);
Handling of different results.