Error in wordpress page console

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

var x = document.getElementById(“main-region”).textContent.indexOf(‘Thank
You For scheduling 22’);
function xyzFunction(){console.log(x);
if(x != -1){
window.location.href = “”;}}
function xyzFunction1() { setInterval(xyzFunction, 3000);}
window.onload = xyzFunction1;

Here is the page in wordpress

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 *