I am trying to Add a DIV which has a image source in it to an HTML. and after i am trying to change the property of above added DIV. But i am not able to do so. The DIV is showing up in the Browser Development tools when checked. The Error i am getting is "Cannot read property 'style' of null". Below is my code. Thanks in advance.\[code\]ajaxLoaddiv='<div class="LoadingImage" alt="example" style="display: none"> <img src="http://stackoverflow.com/questions/15695853/css/ajax-loader.gif"></div>';$(ajaxLoaddiv).appendTo(attachPoint);document.getElementById("LoadingImage").style.display = 'block'; \[/code\]attachpoint is a reference in the html which i got by.\[code\]var attachpoint=document.querySelector('.buttonAttachPoint');\[/code\]