<my-paragraph>
<span slot="my-text">Let's have some different text!</span>
</my-paragraph>Element: assignedSlot property / notebook
Element: assignedSlot property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let slottedSpan = document.querySelector("my-paragraph span");
console.log(slottedSpan.assignedSlot); // logs '<slot name="my-text">'