I have a simple js code, but it doesn't work (no alert when checking the checkbox) what is the prob? :
function dynamicCheckbox() {
var checkbox = document.createElement('input');
checkbox.type = "checkbox";
checkbox.name = "chkbox";
checkbox.id = "chkid" ;
checkbox.style = "width:50px";
checkbox.onclick = "openFiles()";
}
function openFiles() {
alert("hey");
}