document.getElementById to include href

后端 未结 4 485
无人及你
无人及你 2021-01-07 07:08

What is the correct way to turn this into a link?

4条回答
  •  孤街浪徒
    2021-01-07 07:26

    I came accross the issue - Javascript error: Cannot read property 'parentNode' of null. I discovered this was due to executing this code while the DOM is not ready. window.onload solved the issue for me.

    
    

提交回复
热议问题