const bodyElement = document.querySelector("body");
bodyElement.addEventListener("mousemove", (event) => {
const x = event.offsetX;
const y = event.offsetY;
const spanElement = document.createElement("span");
spanElement.style.left = x + "px";
spanElement.style.top = y + "px";
bodyElement.appendChild(spanElement);
});
browser console showing me this error.
inpage.js:200
Uncaught (in promise)
TypeError: Cannot read properties of null (reading 'type')
at Di.<anonymous> (inpage.js:200:122709)
at Generator.next (<anonymous>)
at Pe (inpage.js:200:121668)
Can’t find where it is coming from.
New contributor
Channaka Gunawardhne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.