Change/Get check state of CheckBox

前端 未结 11 926
别跟我提以往
别跟我提以往 2020-12-03 02:30

I just want to get/change value of CheckBox with JavaScript. Not that I cannot use jQuery for this. I\'ve tried something like this but it won\'t work.

JavaScript fu

11条回答
  •  [愿得一人]
    2020-12-03 02:53

    You need this:

    window.onload = function(){
        var elCheckBox=document.getElementById("cbxTodos");
        elCheckBox.onchange =function (){
            alert("como ves");
        }
    };
    

提交回复
热议问题