$(document).ready(function() {
$(".cl").on("click", function() {
$(".inpt").delay(5000).focus();
});
});
.cl {
background: #009;
width: 300px;
height: 100px;
line-height: 100px;
color: #fff;
text-align: center;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" class="inpt">
<div class="cl">click me</div>
问题我有与上面的代码是,delay()
不工作在focus()
。
谢谢,adeneo – sorvz