Home > front end >  How to use js if statement judgment text box input the first letter is capitalized?
How to use js if statement judgment text box input the first letter is capitalized?

Time:10-11

CodePudding user response:

 if (/^ [a-z]/. The test (n1)) {
Alert (" right ");
} else {
Alert (" error ");
}

CodePudding user response:

{don't judge can use CSS text - transform: uppercase}

Determine whether to AB

CodePudding user response:

If it's not true then you can go to the first character to uppercase and compares the characters of
The console. The log (' ABC '. The charAt (0)==='ABC'. The charAt (0). The toUpperCase ())

CodePudding user response:

Bosses with what the editor, pretty

CodePudding user response:

reference 4 floor of the unknown fate of reply:
bosses with what the editor, pretty
hbuilderx
  • Related