我正在尝试添加一些额外的功能,这取决于li元素是否选中了它的复选框。<li class="js-checkbox" id="1"><input type="checkbox">I am list item number 1.</li>
<li class="js-checkbox" id="2"><in
如何修改下面的JS,让它告诉我复选框是选中还是未选中?function toggleOption(x) if (???)alert("Checkbox with number " + x + " was checked"); alert("Checkbox with number " + x +" was UNchecked");<input type="c
我刚刚在CSS中将checkbox设计为toggle switch,它工作得很好。但是,输入的值在onchange事件上似乎没有变化,并且总是显示on。JS代码:/* The switch - the box around the slider */ position: relative; width: 60px;}