Error in wordpress page console

I have a page where i have added code in footer(jscript)

<script>
var x = document.getElementById(“main-region”).textContent.indexOf(‘Thank
You For scheduling 22’);
function xyzFunction(){console.log(x);
if(x != -1){
window.location.href = “https://wpt1.ide4.bid/thank-you”;}}
function xyzFunction1() { setInterval(xyzFunction, 3000);}
window.onload = xyzFunction1;
</script>

Here is the page in wordpress
https://wpt1.ide4.bid/

when i check console i get this error

Uncaught TypeError: Cannot read property ‘textContent’ of null
at (index):263

Please Help to fix it

Read more here:: Error in wordpress page console

Leave a Reply

Your email address will not be published. Required fields are marked *