用button如何关闭popup
javascript弹出一个popup窗口,要在这个窗口里的一个button控件click时关闭这个popup窗口,button的onclick要怎么写,如下:
<SCRIPT LANGUAGE= "JScript ">
var oPopup = window.createPopup();
function ButtonClick()
{
var oPopBody = oPopup.document.body;
oPopBody.id= "body1 "
oPopBody.style.backgroundColor = "lightyellow ";
oPopBody.style.border = "solid black 1px ";
oPopBody.innerHTML = "Click outside <B> popup </B> to close. <button id= 'btn ' onclick= ' '> close </button> ";
oPopup.show(screen.width/2, screen.Height/2, 200, 50, document.body);
}
</SCRIPT>
------解决方案--------------------parent.oPopup.hide();