Skip to content

Instantly share code, notes, and snippets.

@LarrySul
Last active July 21, 2019 18:11
Show Gist options
  • Save LarrySul/63bcc0c7eeecd0bb2636bc94eeeefe3a to your computer and use it in GitHub Desktop.
Save LarrySul/63bcc0c7eeecd0bb2636bc94eeeefe3a to your computer and use it in GitHub Desktop.
intro to html input elements by devLarry
<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