Let's say we have an html5 custom element that extends the HTMLAnchorElement and goes by the name 'custom-a', then we insert it directly in the html like this
<a href="" is="custom-a">Hello World</a>
as expected this will trigger the connectedCallback(), now how do I accomplish the same thing by creating and inserting the custom element via javascript, I tried:
<script>
let elem = document.createElement('a');
elem.setAttribute('is', 'custom-a');
document.body.appendChild(elem);
</script>
But connectedCallback() fails to run