Skip to content

Instantly share code, notes, and snippets.

View vinaynb's full-sized avatar

Vinay Bhinde vinaynb

View GitHub Profile
@vinaynb
vinaynb / email-address-syntax-validation-let-the-browser-do-it.md
Created December 9, 2016 05:34 — forked from nepsilon/email-address-syntax-validation-let-the-browser-do-it.md
Email address syntax validation? Let the browser do it (without regexp) — First published in fullweb.io issue #77

Email address syntax validation? Let the browser do it (without regexp)

Here is a simple and robust way to check for the validity of an email address syntax directly in the browser. No need for crazy regular expressions.

e = document.createElement('input')
e.type = 'email'
// check some email addresses
e.value = 'hi@'