🆕 blog! “How to check something <em>isn't</em> an email address?”
In web-development circles, it is a well-known fact that trying to validate an email using a regular expression is… complex. The full set of modern email standards allows for such wonderful addresses as: chief.o'brien+ds9@spásárthach.भारत So determining whether or not your user has entered a valid …
👀 Read more: https://shkspr.mobi/blog/2023/09/how-to-check-something-isnt-an-email-address/
⸻
#0f0 #f00 #HTML5 #notemail
@2fd7551e
<input id=user>
user.onchange = () => {
let input = document.createElement('input');
input.type = 'email';
input.required = true;
input.value = user.value;
if (input.validity.valid) {
// show error message
}
};
https://output.jsbin.com/jafovub/quiet
@2fd7551e Really, check for '@' and check you can resolve the part after '@' (maybe is there a MX for it). Then you're good.