var hdiv = document.getElementById("hotlog_counter"); if(!hdiv) { document.write('HotLog<\/a>'); } else { hdiv.innerHTML = 'HotLog<\/a>'; }