I'm trying to click a HTMLElement using click() method but i got that error message. in the down below section I just added my function that will click a element.
export const clickNextSibling = (
clickedElement: SVGCircleElement,
max: number = 6
) => {
let nextElement: HTMLElement =
clickedElement.nextElementSibling as HTMLElement;
if (nextElement) {
nextElement.click();
console.log("clicked!");
}
};