本文小編為大家詳細介紹“HTML5的body屬性怎么設置”,內容詳細,步驟清晰,細節處理妥當,希望這篇“HTML5的body屬性怎么設置”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學習新知識吧。
body元素就是就是html文檔的主內容標簽。
可設置屬性
onafterprint 在打印文檔之后運行腳本
onbeforeprint 在文檔打印之前運行腳本
onbeforeonload 在文檔加載之前運行腳本
onblur 當窗口失去焦點時運行腳本
onerror 當錯誤發生時運行腳本
onfocus 當窗口獲得焦點時運行腳本
onhaschange 當文檔改變時運行腳本
onload 當文檔加載時運行腳本
onmessage 當觸發消息時運行腳本
onoffline 當文檔離線時運行腳本
ononline 當文檔上線時運行腳本
onpagehide 當窗口隱藏時運行腳本
onpageshow 當窗口可見時運行腳本
onpopstate 當窗口歷史記錄改變時運行腳本
onredo 當文檔執行再執行操作(redo)時運行腳本
onresize 當調整窗口大小時運行腳本
onstorage 當文檔加載加載時運行腳本
onundo 當文檔執行撤銷操作時運行腳本
onunload 當用戶離開文檔時運行腳本
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;
};
讀到這里,這篇“HTML5的body屬性怎么設置”文章已經介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領會,如果想了解更多相關內容的文章,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。