How to use onClick ONLY if email input field is valid?

RichardMaretti

New Member
Here's code:\[code\]<input id="subscribe-email" type="email" placeholder="[email protected]" /> <button type="submit" id="subscribe-submit" onClick="javascript:omgemailgone();" />\[/code\]How do I check and run JS function only if email is valid (validation by user-agent, no additional validations)?UPDATE.New browsers can validate input=email by themselves, also there are pseudo classes :valid and :invalid. I need to run function only if browser 'knows' that email is valid.
 
Back
Top