Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
    <title>Changing a checkbox</title>
    <link rel="stylesheet" href="https://js.arcgis.com/3.15/esri/css/esri.css">
    <link rel="stylesheet" href="https://js.arcgis.com/3.15/dijit/themes/claro/claro.css">
    <style>
        html, body, #map {
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
    <script src="https://js.arcgis.com/3.15/"></script>
    <script>
        var map;
        require(["dijit/form/CheckBox", "dijit/form/Button", "dojo/dom", "dojo/domReady!"], function (CheckBox, Button, dom) {
            var checkBox = new CheckBox({
                id: "chkTest",
                name: "checkBox",
                value: "agreed",
                checked: true
            }, "checkBox").startup();
            var myButton = new Button({
                label: "Change checkbox",
                onClick: function () {
                    // Do something:
                    dijit.byId("chkTest").set("checked", !dijit.byId("chkTest").checked);
                }
            }, "btnTest").startup();
        });
    </script>
</head>
<body class="claro">
    <div>
        <input id="checkBox" /> <label for="checkBox">Testing</label>
        <button id="btnTest" type="button"></button>
    </div>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
kenbujapro
0viewers