That's my code when I run it the openFiles
function (that needs to be fired only after checkbox is clicked) fires anyway and that
obj is the window not the checkbox... why ? how to fix that? what am I missing?
function openFiles(that) {
alert("have not touched js for a long time :(");
}
function checkbox (){
var checkbox = document.createElement('input');
checkbox.type = "checkbox";
checkbox.name = "chkbox";
checkbox.id = "chkid" ;
checkbox.style = "width:50px";
checkbox.onclick = openFiles(this);
}