Is there a way to retrieve the parent web element of a pseudo element (if we can call it the parent) using JavaScript? I know that Selenium's methods for searching for web elements are not suitable for pseudo elements, but JavaScript does allow manipulation of them. So, my question is whether there is a method in JavaScript that could provide the css selector/xpath of the parent web element for a pseudo element (::after).
To illustrate:
<html>
<body>
<label id="parent">
<span> Some text </span>
::after
</label>
</body>
</html>
And what I would like to achieve is getting "#parent".
I appreciate any guidance on this matter.