Uncaught TypeError: Cannot set property ‘onclick’ of null

Wrap code in

window.onload = function(){ 
    // your code 
};

Leave a Comment