js中关于简单事件的处理与浏览器对象!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01//ENhttp://www.w3.o
js中关于简单事件的处理与浏览器对象
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>js01_hello</title><meta name="author" content="Administrator" /><script type="text/javascript">function bless() {//获取输入的祝福语var mb = document.getElementById("mb").value;//获取父类窗口var p = window.opener;//获取父类窗口中的id为bless的divvar pd = p.document.getElementById("bless");//设置pd的值pd.innerHTML = mb;//关闭当前窗口window.close();}</script></head><body>输入祝福语:<input type="text" size="40" id="mb"/><input type="button" onclick="bless()" value="输入" /></body></html>