修改写法为: window.setTimeout(function (){ obj.focus(); }, 0); window.setTimeout(function(){ obj.select(); }, 0);