子頁面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>