$('#firstname').bind('focusout focusin', function() {
var get_firstname = $("#firstname").val().replace(/ /g, "+");
var n_firstname = get_firstname.length;
if (n_firstname > 2) {
$(".firstname_good").fadeIn("fast");
var firstname_v = 1;
}
else {
$(".firstname_good").fadeOut("fast");
var firstname_v = '';
}
});
我无法理解如何使用下面的 VAR firstname_v。我需要在上面做什么才能在下面使用它
$('#lastname').bind('focusout focusin', function() {
if (firstname_v == 1) {
alert(firstname_v);
}
});