I have a template like so:
<template id="my-template">
<div></div>
</template>
That I convert to document fragment like so:
const elementFragment = document.getElementById("my-template").content.cloneNode(true);
And then I add this element with append:
document.body.append(elementFragment);
Now the issue is that I need a reference to the appended element, but the reference I have is only a Dogument-Fragment instead of being a HTLMDivElement.
How can I get the actual DOM element?