body元素就是就是html文檔的主內(nèi)容標簽。
可設(shè)置屬性
onafterPRint 在打印文檔之后運行腳本
onbeforeprint 在文檔打印之前運行腳本
onbeforeonload 在文檔加載之前運行腳本
onblur 當(dāng)窗口失去焦點時運行腳本
onerror 當(dāng)錯誤發(fā)生時運行腳本
onfocus 當(dāng)窗口獲得焦點時運行腳本
onhaschange 當(dāng)文檔改變時運行腳本
onload 當(dāng)文檔加載時運行腳本
onmessage 當(dāng)觸發(fā)消息時運行腳本
onoffline 當(dāng)文檔離線時運行腳本
ononline 當(dāng)文檔上線時運行腳本
onpagehide 當(dāng)窗口隱藏時運行腳本
onpageshow 當(dāng)窗口可見時運行腳本
onpopstate 當(dāng)窗口歷史記錄改變時運行腳本
onredo 當(dāng)文檔執(zhí)行再執(zhí)行操作(redo)時運行腳本
onresize 當(dāng)調(diào)整窗口大小時運行腳本
onstorage 當(dāng)文檔加載加載時運行腳本
onundo 當(dāng)文檔執(zhí)行撤銷操作時運行腳本
onunload 當(dāng)用戶離開文檔時運行腳本
DOM 接口
代碼: 全選 運行
interface HTMLBodyElement : HTMLElement {
attribute Function onafterprint;
attribute Function onbeforeprint;
attribute Function onbeforeunload;
attribute Function onblur;
attribute Function onerror;
attribute Function onfocus;
attribute Function onhashchange;
attribute Function onload;
attribute Function onmessage;
attribute Function onoffline;
attribute Function ononline;
attribute Function onpopstate;
attribute Function onpagehide;
attribute Function onpageshow;
attribute Function onredo;
attribute Function onresize;
attribute Function onscroll;
attribute Function onstorage;
attribute Function onundo;
attribute Function onunload;
};
新聞熱點
疑難解答