(原文鏈接:https://www.nowcoder.com/questionTerminal/2c5d8105b2694d85b06eff85e871cf50)
document.write是重寫整個document, 寫入內容是字符串的html
innerHTML是HTMLElement的屬性,是一個元素的內部html內容
document.write會重繪整個頁面,而innerHTML是可以重繪頁面的某一部分
(原文鏈接:https://www.nowcoder.com/questionTerminal/2c5d8105b2694d85b06eff85e871cf50)
document.write是重寫整個document, 寫入內容是字符串的html
innerHTML是HTMLElement的屬性,是一個元素的內部html內容
document.write會重繪整個頁面,而innerHTML是可以重繪頁面的某一部分
(function(d, s, id) { let js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) retur