is this correct syntax to create onclick event on dynamic html document

Posted by user321382 on Stack Overflow See other posts from Stack Overflow or by user321382
Published on 2010-04-21T09:09:19Z Indexed on 2010/04/21 9:13 UTC
Read the original article Hit count: 205

Filed under:

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);};

© Stack Overflow or respective owner

Related posts about dynamically-generated