$(document).on("blur","#email",function() { var freeServices = ['0-mail.com', '027168.com', '0815.su', '0sg.net']; for(var i = 0; i < freeServices.length; i++) { if ($(this).val().indexOf(freeServices[i]) != -1) { $(this).val(" "); $(this).after('<div style="color: #db2626;">Invalid email Type</div>'); } } });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter