While our message will be easily spotted by sighted users, people using assistive technology like screen readers may not inherently know a message has been added to the DOM.
See the Pen Form Validation: Mail Chimp with Ajax Submit by Chris Ferdinandi (@cferdinandi) on Code Pen.
See the Pen Form Validation: The Mail Chimp Simple Signup Form by Chris Ferdinandi (@cferdinandi) on Code Pen.
Now, let's add in a few input types and validation attributes so that the browser can natively validate the form for us.
Our validation script is just 6.7kb minification, making it 20x smaller than the one Mail Chimp provides.
If we want to ensure support back to IE9, though, we should include our Validity State polyfill and Eli Grey's class polyfill.