The checkboxradio widget can be used to take input from the user. The major difference between the traditional checkboxradio button and the one in jQuery UI is the ease with which it can stylize the button. This widget allows working around that limitation by positioning the associated label on top of the hidden input and emulating the checkbox or radio element itself using an (optional) icon.
- destroy: It is used to remove the checkboxradio functionality of jQuery UI and change it to standard checkbox without any styling.
- disable: Disables the checkboxradio buttons.
- enable: Enables the checkboxradio button if it has been previously disabled.
- instance: Returns the checkbox’s last instance object if there is no object selected, it returns undefined.
- refresh: Used to refresh the appearance of the widget, useful after changing and applying different themes.
- widget: Returns the complete checkboxradio as a jQuery widget object.
Example 1: Let us create a simple checkbox radio with a basic theme, Here is the code for this.
Applying a theme: The theme can be changed by changing the CSS file. Here, some predefined CSS files have been used in jQuery UI. The change in the CSS file being called inside the head tag.
Note: In the above example r2 and c2 are the id’s of the div tag. For applying it to a class add “$” before class name.
Here we have used the theme “le-frog”. As it has been specified in this line.
<link rel=’stylesheet’ href=’https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/le-frog/jquery-ui.css’>
- jQuery UI | Controlgroup Widget
- How to design filter widget for mobiles using jQuery plugin ?
- How to use jQuery UI MultiSelect Widget ?
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.fx.off Property
- jQuery | jQuery.support Property
- jQuery | jquery Property
- JQuery | Multiple ID selectors
- jQuery | :input Selector
- jQuery | prepend() with Examples
- jQuery | dblclick() with Examples
- jQuery | offset() with Examples
- How to find the parent class name with known class in jQuery ?
- jQuery | Introduction
- jQuery | :nth-of-type() Selector
- How to Design Color Picker using jQuery UI ?
- jQuery | children() with Examples
- jQuery UI | position() Method
- jQuery | Hide/Show, Toggle and Fading methods with Examples
- JQuery | parseHTML() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.