html checkbox元素.html

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>checkbox</title>

    <script src="js/jquery-2.1.4.min.js"></script>
</head>
<body>
<input type="checkbox" id="chkDebugFrustum" value="this" name="jiaodu" checked>
<label for="chkDebugFrustum">顯示框線</label>
<script>
    $(function () {
        // 複選框更改事件。
        $("#chkDebugFrustum").change(function () {
            let e = $(this).is(":checked");
            console.log("e:", e);
            // e: true
            // e: false
        })
    })
</script>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章