Error when trying to store a DOM element to later execute methods on it

  Kiến thức lập trình

When I try to access a DOM element to later execute methods on it I get an error

command: execute script
target: return document.querySelector('div.some-class')
value: result

The error I get is:

executeScript on return document.querySelector('div.some-class'); with value selectionRect Failed: and is undefined

The element exists, is present and is visible

Any hint on how to handle this scenario?

Greetings and thanks in advance

LEAVE A COMMENT