checked

The checked() method, called without any parameters, will return the current checked state of a Button element.
The checked(bool) method is used to update a Button's checked/unchecked state. Passing true will check the element.
This method is only applicable when the toggle property of the button widget is enabled.


<button id="but1" ></button>

<script type="text/javascript">

     $(function () {
        $("#but1").shieldButton({
            toggle: true
        });
    });

    $("#but1").swidget().checked(); // return false
    
    $("#but1").swidget().checked(true) // check the button
    
    $("#but1").swidget().checked(); // return true

</script>