var container = document.getElementById("gpViewCount"); if(container){ container.innerHTML = "1002"; }else{ document.write("1002"); }