Changing a checkbox's state programmatically in dashcode

前端 未结 8 1461
一个人的身影
一个人的身影 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:02

    cell = row.insertCell(-1);
    sel = document.createElement('input');
    sel.setAttribute("type", "checkbox")
    sel.setAttribute("name", "myCheckBox")
    cell.appendChild(sel);
    cell.getElementsByTagName('input')[0].checked = true;
    

    I create a table, row then cell and create a checkbox within it. I can the grab hold of the first input object and set the checked status to true.

提交回复
热议问题