Changing a checkbox's state programmatically in dashcode

前端 未结 8 1598
长发绾君心
长发绾君心 2021-02-15 01:28

Okay, so I\'m trying to change a checkbox\'s state programmatically in dashcode. I\'ve tried:

var checkbox = document.getElementById(\"checkbox\");

// I have tr         


        
8条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 02:10

    I don't know which browser you used, but when I tested on FF 3.6, it works. just put like this:

    checkbox.checked = false;
    

    while:

    checkbox = document.getElementById('blablabla');
    

    or write like that

    document.getElementById('idhere').checked = false;
    

提交回复
热议问题