Last active
July 21, 2019 18:11
-
-
Save LarrySul/63bcc0c7eeecd0bb2636bc94eeeefe3a to your computer and use it in GitHub Desktop.
intro to html input elements by devLarry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input | |
type="text" | |
placeholder="first and last name" | |
required | |
pattern="(.*)\s(.*)" | |
/> | |
<input | |
type="text" | |
placeholder="username" | |
pattern="/^[a-zA-Z0-9_]+$/" | |
maxlength="15" | |
/> | |
<!-- leveraging on the power of regular expression to enforce validation rules to the pattern attribute | |
and also adopting the maxlength which returns true when an element value length is longer than thethe value in the maxlength attribute | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment