Thursday, 19 March 2015

How can use Regular Expressions in HTML?


We can use a Regular Expressions width the help of HTML 5. You can use this with "textarea" and "Input" tags.

<form action="" method="post">    
   <label for="username">Create a Username: </label>    
    <input type="text"          name="username"          id="username"         placeholder="4 <> 10"         pattern="[A-Za-z]{4,10}"         autofocus         required>      <button type="submit">Go </button>  </form>

You’ll be aware that this pattern: [A-Za-z]{4,10} accepts only upper and lowercase letters. This string must also have a minimum of four characters, and a maximum of ten.

For more blogs just visit http://findnerd.com/NerdDigest/Html/

No comments:

Post a Comment