我有以下代码在 jQuery 1.3.2 上完美运行:
$("#passwordLabel").click(function()
{
$(this).hide();
$("#password").focus();
}
);
$("#confirmpasswordLabel").click(function()
{
$(this).hide();
$("#confirmpassword").focus();
}
);
$("#password").focus(function()
{
$("#passwordLabel").hide();
}
);
$("#confirmpassword").focus(function()
{
$("#confirmpasswordLabel").hide();
}
);
$("#password").blur(function()
{
if($(this).val()=="")
{
$("#passwordLabel").show();
}
}
);
$("#confirmpassword").blur(function(value)
{
if($(this).val()=="")
{
$("#confirmpasswordLabel").show();
}
}
);
});
但不幸的是,当我将 jQuery 库更改为 1.6.4 版时,这些代码不再起作用。
那是因为 jQuery 1.6.4 不再有这种语法了吗?