0
我想獲得ID和複選框的狀態(我有CSS的按鈕CSS Button)複選框數據綁定返回兩個值?
按鈕的名稱,並積極
<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>
按鈕作品和展示真假,我無法弄清楚如何獲得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
});
}
FYI想做一個插件Octoprint –