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

The checked(bool) method is used to update a Switch checked state. Passing true will check it and false will set the widget as unchecked.

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

<script type="text/javascript">
    $(function () {
            // set initially as unchecked
            checked: false

        // will print false

        // set as checked

        // will print true