第二个输入应仅在第一个输入字段填写后出现
second input should appear ONLY AFTER first input field filled in
我想找出一些方法 'second input should appear ONLY AFTER first input field filled in'。
我试图在 Foogle、jquery 站点和 Whosebug 上对此进行研究,但找不到任何东西。
我该怎么做?
$("#first").keyup(function() {
var id = $(this).val();
if ((id).length > 5) {
$("#second").fadeIn("slow");
}
else
{
$("#second").fadeOut("slow");
}
})
#second {
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<input type="text" id="first">
<input type="text" id="second">
希望对您有所帮助
我想找出一些方法 'second input should appear ONLY AFTER first input field filled in'。
我试图在 Foogle、jquery 站点和 Whosebug 上对此进行研究,但找不到任何东西。
我该怎么做?
$("#first").keyup(function() {
var id = $(this).val();
if ((id).length > 5) {
$("#second").fadeIn("slow");
}
else
{
$("#second").fadeOut("slow");
}
})
#second {
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<input type="text" id="first">
<input type="text" id="second">
希望对您有所帮助