0
我有一个像这样的表单域。现在表单域的超时处理
<form action="/action_page.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
Title: <input type="text" name="title"><br>
Your Message: <textarea rows="4" cols="50"></textarea><br>
<input type="submit" value="Submit">
</form>
当用户在5秒钟后不活动,我将会触发例如有帮助的信息警报(后一个div通知)。所以此工作与此代码:
<script>
$("#contact input").on("click",function(){
clearTimeout(myTimeout);
});
var myTimeout = setTimeout(function(){
alert("How can i help you");
}, 5000);
myTimeout;
</script>
当用户在每个输入字段中单击时,超时已清除。
我的待办事项现在
为延长,现在我的本意是推动相同的警报,当用户停止填写输入域或什么都不做10秒后,随后的。我不知道如何实现它。我希望得到支持。感谢一位新手。
检查元素是否具有“焦点”且值为空! – Rayon