Cannot read property 'getElementsByTagName' of null

在調試JS代碼的過程當中遇到錯誤:Cannot read property ‘getElementsByTagName’ of null 以下圖: 修改成:document.getElementsByTagName(’li’); 緣由:getElementsByTagName是document的方法,只能經過document調用web
相關文章
相關標籤/搜索