is this correct syntax to create onclick event on dynamic html document
- by user321382
var val1=document.createElement("input");
val1.setAttribute('type',"image");
val1.setAttribute('src',"../images/delete.gif");
val1.setAttribute('id',chkid);
val1.setAttribute('name',"val2");
val1.setAttribute('class',"mylist2");
val1.onclick=function(){var block=document.getElementById("repeat_ul");
var obj=document.getElementById('country_chk');
document.block.removeChild(obj);};