日期:2014-05-17  浏览次数:20598 次

高级问题:js已经得到对象,但是却没有向下执行

function hideMsg2(obj1,obj2)
{
var t3 = document.getElementById(obj1.id).value;
if((t3==null)||(t3=="")||(t3=="password"))
{
document.getElementById(obj1.id).value = "";
$(obj1.id).hide(slow);
$(obj2.id).show(slow);
        document.getElementById(obj2.id).focus();
alert(obj2.id);
}
}

看代码,我能得到两个对象的id,但是要显示和隐藏的动作都不执行,为什么?
------解决方案--------------------
才发现你的jquery写错了

$("#XX")


所以你这里应该是$("#"+obj.id)