Posted in Javascript onJanuary 01, 2011
子页面HTML:
<input type="checkbox" name="check" onclick="CheckedBox(this)" value="a" />
子页面JS:
function CreateIOC(text,value) { var o = document.createElement("a"); o.id = value; o.href = "#"; o.className = "c"; o.style.border = "2px solid red"; o.style.width = "250px"; o.style.height = "30px"; o.style.display = "block"; o.innerHTML = "<table><tr><td>" + text + "</td><td><img src='/JavaScripts/Data/close.gif' width='13' height='13'/></td></tr></table>"; o.setAttribute("onclick", "iocClick()"); return o; } function iocClick() { alert('ok'); } function CheckedBox(box) { window.parent.document.getElementById("kdks_panel").appendChild(CreateIOC('1','2')); }
父级HTML:
<div id="kdks_panel"></div>
javascript 事件绑定问题
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@