如何关闭/隐藏一个div ONLY
after the input fields have been filled out.
我想使用 JavaScript
来完成 hide/close
而无需提交按钮。(我不知道如何)所以一旦输入字段在那里完成在 div 隐藏/关闭之前有几秒钟的延迟。
<div id="hide">
<label> Type your name </label>
<input type="text" name="personal"/>
</div>
最佳答案
$("#txtbx").keyup(function(){
setTimeout(function ()
{
$("#hide").hide();
},3000);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="hide">
<label> Type your name </label>
<input type="text" name="personal" id="txtbx"/>
</div>
希望!!!有帮助!!
关于javascript - 仅在输入完成时关闭/隐藏 div,没有提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44253714/