An email is only going to contain one @ so you could split the input value and take the second part
str = str.split('@').slice(1);
then simply check if that is in your acceptable list
var allowedDomains = [ 'x.com', 'y.com', 'z.com' ];
if ($.inArray(str[0], allowedDomains) !== -1) {
//acceptable
}else{
//not acceptable
}
here is a working example in a jsfiddle: http://jsfiddle.net/UwmYK/2/ just type in the email and click run.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…