I have a component which uses named slots from <another-component>
. I was trying to get the <span>
by calling this.shadowRoot.getElementById('title')
in <another-component>
, it always returns null:
render() {
return html`
<another-component>
<h2 slot="header">
<span id="title"></span>
</h2>
<div slot="footer">
${this.renderFooter()}
</div>
</another-component>
`;
}
Any ideas?