Deprecated text selection API. Will be removed in 2.0. New code should use dijit/selection.
Function to collapse (clear), the current selection
Parameter | Type | Description |
---|---|---|
beginning | Boolean | Indicates whether to collapse the cursor to the beginning of the selection or end. |
Return the parent element of the current selection which is of type tagName (or one of the other specified tagName)
Parameter | Type | Description |
---|---|---|
tagName | String | The tag name to determine if it has an ancestor of. |
Get the parent element of the current selection
Function to locate a parent node that matches one of a set of tags
Parameter | Type | Description |
---|---|---|
node | DomNode | The node to inspect. |
tags | String[] |
The node to inspect.
Retrieves the selected element (if any), just in the case that a single element (object like and image or a table) is selected.
Return the html text of the current selection or null if unavailable
Return the text (no html tags) included in the current selection or null if no text is selected
Get the selection type (like win.doc.select.type in IE).
Check whether current selection has a parent element which is of type tagName (or one of the other specified tagName)
Parameter | Type | Description |
---|---|---|
tagName | String | The tag name to determine if it has an ancestor of. |
This function determines if 'node' is in the current selection.
Parameter | Type | Description |
---|---|---|
node | undefined |
Function to determine if a node is one of an array of tags.
Parameter | Type | Description |
---|---|---|
node | DomNode | The node to inspect. |
tags | String[] |
Function to delete the currently selected content from the document.
clear previous selection and select element (including all its children)
Parameter | Type | Description |
---|---|---|
element | DOMNode | The element to select. |
nochangefocus | Boolean |
Optional Boolean indicating if the focus should be changed. IE only. |
clear previous selection and select the content of the node (excluding the node itself)
Parameter | Type | Description |
---|---|---|
element | DOMNode | The element you wish to select the children content of. |
nochangefocus | Boolean |
Optional Indicates if the focus should change or not. |