JavaScript TypeError: Cannot read property 'style' of null

前端 未结 6 1917
一向
一向 2020-11-30 00:25

I have JavaScript code and below line has problem.

if ((hr==20)) document.write(\"Good Night\"); document.getElementById(\'Night).style.display=\'\'
<         


        
6条回答
  •  感动是毒
    2020-11-30 01:15

    For me my Script tag was outside the body element. Copied it just before closing the body tag. This worked

    enter code here
    

    Black Jack

    by Meg

    Welcome to blackJack!

提交回复
热议问题