focus和blur事件样例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>focus和blur事件</title>
</head>
<body>
<input type="text" id="i1">
<script src="jquery-3.3.1.min.js"></script>
<script>
    $("i1").on("focus",function () {
        console.log(123)
    });
    $("i1").on("blur",function () {
        console.log($(this).val());
    });
    $("i1").on("input",function () {
        console.log($(this).val())
    })
</script>

</body>
</html>

猜你喜欢

转载自www.cnblogs.com/guanzhicheng/p/9147300.html
今日推荐