<my-paragraph>
<span slot="my-text">Let's have some different text!</span>
</my-paragraph>Element: slot property / notebook
Element: slot 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.slot); // logs 'my-text'