Switch Overview
The Switch displays two exclusive choices.
When initialized, the Switch renders the currently selected value. The Switch can be created from an input
element of type checkbox
. The default styling of the Switch widget for each of the Sass-based Kendo UI for jQuery themes can be modified to match the desired custom layout. For more information and examples, refer to the article on implementing a custom layout for the Switch.
The Switch is part of Kendo UI for jQuery, a
professional grade UI library with 90+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
Initializing the Switch
To create the Switch, use an HTML <input>
element.
<input id="switch" />
To initialize the Switch, use a jQuery selector.
$(document).ready(function() {
$("#switch").kendoSwitch();
});
Functionality and Features
Referencing Existing Instances
To reference an existing Switch instance, use the jQuery.data()
method. Once a reference has been established, use the API to control its behavior.