Simple coment hide script for WordPress Site?

<script type=”text/javascript” language=”javascript”>

//alert(document.getElementById(‘comments’));

var comLength = document.getElementById(“comments”).innerHTML;

/*alert(comLength);

alert(comLength.length);*/

if(comLength.length == “0”){

//alert(‘test’);

document.write(‘<style type=”text/css”>#comments{display:none;}</style>’);

}

else{

document.write(‘<style type=”text/css”>#comments{display:block;}</style>’);

//alert(“Test Else”+comLength.length);

}

</script>

Leave a Reply

© 2020 Spirituality