> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: onSelectionChange() ## Article: onSelectionChange() ## Article Link: https://dev.wix.com/docs/sdk/host-modules/editor/elements/on-selection-change.md ## Article Content: # onSelectionChange() This method registers a callback function as an event handler. The event is triggered when the user changes the element selection in the editor. ## Syntax ```ts function onSelectionChange(handler: (elements: Element[]) => void): void ``` ## Parameters | Name | Type | Description | | :---- | :---- | :---- | | `handler` | (elements: [Element](https://dev.wix.com/docs/sdk/host-modules/editor/elements/element/introduction.md)[]) => void | Callback function that receives an array of selected elements. | ## Example ```javascript import { editor, elements } from '@wix/editor'; import { createClient } from '@wix/sdk'; const client = createClient({ host: editor.host(), modules: { elements } elements.onSelectionChange((selectedElements) => { console.log('Selected elements:', selectedElements); } }); ```