问题
I have an input field, where user has to add his address, but I need to get at least one number (house number). How should I validate that field ? Thanks in advance for any help.
回答1:
Answering the question, to see if a string contains at least one number :
if ( string.match(/\d/) ) {
// do something
}
FIDDLE
来源:https://stackoverflow.com/questions/17364013/at-least-one-number-in-input-field-jquery