htmlElement.style 是隻讀屬性

document.getElementById('test').style = 'opacity:0';ios

在某些機型上,好比蘋果 ios 10機型上,會報錯。提示 style 屬性爲只讀屬性。ci

建議全部的代碼都改成 document.getElementById('test').setAttribute('style','opacity:0')get

相關文章
相關標籤/搜索