这样写可以么
$(function () {
$("input")
.bind("focus", function () {
$("div").html("请输入您的姓名!");
})
,$("input")
.bind("blur",function () {
if ($(this).val().length == 0)
$("div").html("你的名称不能为空!");
})
});
我看同学代码有focus: 、blur:的写法。 这样有问题么。
$(function () {
$("input")
.bind("focus", function () {
$("div").html("请输入您的姓名!");
})
,$("input")
.bind("blur",function () {
if ($(this).val().length == 0)
$("div").html("你的名称不能为空!");
})
});
我看同学代码有focus: 、blur:的写法。 这样有问题么。
2016-01-05
举报