I am attempting to extract the ID and checkbox status associated with a CSS button.
The goal is to retrieve the name of the button and determine if it is active or not.
<div class="onoffswitch">
<input type="checkbox" data-bind="checked: ioValue" class="onoffswitch-checkbox" id="io1">
<label class="onoffswitch-label" for="io1">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
While the button functions correctly and displays true or false, I am struggling to capture the ID.
self.ioEvent = function(data, event) {
console.log(1)
console.log(data)
console.log(data[0])
console.log(data[1])
$.ajax({
type: "GET",
dataType: "json",
data: {"io": data[0], "status": data[1]},
url: "/plugin/test/setIOcheckbox",
async: false
});
}