Changing a checkbox's state programmatically in dashcode

前端 未结 8 1456
一个人的身影
一个人的身影 2021-02-15 01:22

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:23

    Maybe:

    checkbox.checked = "checked";
    

    Then:

    checkbox.checked = "unchecked";
    
    0 讨论(0)
  • 2021-02-15 02:25
    checkbox.setAttribute("checked", "checked"); // set
    checkBox.removeAttribute("checked"); // remove
    
    0 讨论(0)
提交回复
热议问题