js在firefox中的问题

代码在firefox中会弹出莫名奇妙的问题:

jQuery("#txtNewPassword").focus();
jQuery("#txtNewPassword").select();

alert("密码中包含不合法字符,可支持字母、数字、及\_\~\@\#\$\^符号");
正确的写法应该是:

alert("密码中包含不合法字符,可支持字母、数字、及\_\~\@\#\$\^符号");

jQuery("#txtNewPassword").focus();
jQuery("#txtNewPassword").select();

注意代码的顺序!

原文地址:https://www.cnblogs.com/chy8219/p/1258158.html