jQWidgets jqxButtonGroup unselected Event
Last Updated :
04 Oct, 2021
jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxButtonGroup is used to illustrate a jQuery widget that generates a group of buttons that functions as a normal button, radio buttons, or checkboxes.
The unselected event is activated whenever the displayed jqxButtonGroup is unselected and the mode must be either checkbox or radio.
Syntax:
$('#jqxButtonGroup').on('unselected', function () {});
Linked Files: Download jQWidgets from the link. In the HTML file, locate the script files in the downloaded folder.
<link rel=âstylesheetâ href=âjqwidgets/styles/jqx.base.cssâ type=âtext/cssâ />
<script type=âtext/javascriptâ src=âscripts/jquery-1.11.1.min.jsâ></script>
<script type=âtext/javascriptâ src=âjqwidgets/jqxcore.jsâ></script>
<script type=âtext/javascriptâ src=âjqwidgets/jqxbuttons.jsâ></script>
The below example illustrates the jqxButtonGroup unselected event in jQWidgets.
Example:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link
rel="stylesheet"
href="jqwidgets/styles/jqx.base.css"
type="text/css"
/>
<script type="text/javascript"
src="scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript"
src="jqwidgets/jqxcore.js"></script>
<script type="text/javascript"
src="jqwidgets/jqxbuttons.js"></script>
</head>
<body>
<center>
<h1 style="color: green">GeeksforGeeks</h1>
<h3>jQWidgets jqxButtonGroup unselected event</h3>
<br />
<div id="jqxBG">
<button style="padding: 6px 36px"
id="l">1st</button>
<button style="padding: 6px 36px"
id="c">2nd</button>
<button style="padding: 6px 36px"
id="r">3rd</button>
</div>
</center>
<div id="log"></div>
<script type="text/javascript">
$(document).ready(function () {
$("#jqxBG").jqxButtonGroup({
mode: "checkbox",
});
$("#jqxBG").jqxButtonGroup("setSelection", 1);
$("#jqxBG").on("unselected", function (event) {
$("#log").html(
"Button with index " + event.args.index
+ " is unselected!"
);
});
});
</script>
</body>
</html>
|
Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxbutton/jquery-button-api.htm?search=
Share your thoughts in the comments
Please Login to comment...