JSFiddle - React, Tailwind, and code Playground
by m4xout
HTML
<input type="text" id="customr21" name="customer[school_email]" class="customr-control" autocomplete="off">
<input type="submit" class="btn btn-primary button action-button" value="Create Account">
JavaScript
$('.action-button').on('click', function(){
str = $('input#customr21').val();
str = str.split('@').slice(1);
var allowedDomains = [ 'steve.com', 'Pete.com', 'jack.com', 'John.com' ];
if ($.inArray(str[0], allowedDomains) !== -1) {
alert(str + ' is allowed');
}else{
alert(str + ' not allowed');
}
});