enabled

The enabled() method, called without any parameters, will return the current enabled state of a Switch element.

The enabled(bool) method is used to update a Switch enabled/disabled state. Passing true will enable and false will disable the widget.

<input id="switch" type="checkbox" />

<script type="text/javascript">
    $(function () {
        $("#switch").shieldSwitch({
            enabled: false,
            checked: true
        });

        // will print false
        console.log($("#switch").swidget().enabled());

        // enable the widget
        $("#switch").swidget().enabled(true);

        // will print true
        console.log($("#switch").swidget().enabled());
    });
</script>