您好,我尝试在字段中的整数为4时隐藏组。
$( "#ssnInput" ).keyup(function() {
if( $('#ssnInput').value.toString().length = 4 ) {
$('#ssnInputGroup').style.display = "none";
}
});
知道为什么这行不通吗?
您好,我尝试在字段中的整数为4时隐藏组。
$( "#ssnInput" ).keyup(function() {
if( $('#ssnInput').value.toString().length = 4 ) {
$('#ssnInputGroup').style.display = "none";
}
});
知道为什么这行不通吗?
I believe that you are using
jquery
and so you should be doing.val()
instead of.value
.In fact, I think you are mixing up the two things. Even where you are setting the display to none. It should just be
.hide()
.你有逻辑上的问题
应该
First of all, you are missing
=
.Secondly, you can use
.val()
.像这样: