Почему ошибка Uncaught TypeError: Cannot read property 'style' of nul?

Почему ошибка Uncaught TypeError: Cannot read property 'style' of null at block1?

Исходный код:

var date = new Date().getTime();

var block1 = function(){
    document.getElementById("shape").style.display = "block";
}


document.getElementById("shape").onclick = function(){  
    var date1 = new Date().getTime();
    document.getElementById("shape").style.display = "none";
        console.log(date1);
document.write((date1 - date) / 1000 + " sec");
setTimeout(block1, 2000);
}

Ответы (0 шт):