The assignedElements() property of the HTMLSlotElement interface returns a sequence of the elements assigned to this slot (and no other nodes). If the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot. If no assigned nodes are found, it returns the slot's fallback content.


var assignedElements = HTMLSlotElement.assignedElements(options)


options Optional
An object that sets options for the nodes to be returned. The available options are:
  • flatten: A Boolean indicating whether to return the assigned elements of any available child <slot> elements (true) or not (false). Defaults to false.

Return value

An array of elements.


let slots = this.shadowRoot.querySelector('slot');
let elements = slots.assignedElements({flatten: true});


Specification Status Comment
HTML Living Standard
The definition of 'assignedElements()' in that specification.
Living Standard

Browser Compatibility

ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Chrome Full support 65Edge Full support 79Firefox Full support 66IE No support NoOpera Full support YesSafari ? WebView Android Full support 65Chrome Android Full support 65Firefox Android Full support 66Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 9.0


Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.