這一個有效,它顯示了表格:當我輸入 .style.display = "tablerow" 時,該函數有效var getMain = document.getElementById("main").style.display = "table-row";var getLocalStorage = localStorage.hasOwnProperty('tableFill');for (i = 0; i < getLocalStorage.lenght; i++) { if (getLocalStorage[i]){ getMain; 但是當我把它放在 for 循環中時它不再工作了,但我在控制臺中也沒有得到任何錯誤......var getMain = document.getElementById("main");var getLocalStorage = localStorage.hasOwnProperty('tableFill');for (i = 0; i < getLocalStorage.lenght; i++) { if (getLocalStorage[i]){ getMain.style.display = "table-row";
為什么一個功能有效,而另一個無效?
墨色風雨
2022-01-07 10:21:28