Web API Selection.extend() Method
The Web Selection API gives developers the ability to recognize the screen regions that the user has now selected and to use code to initiate user selections.
The extend() method moves the focus of the selection of a specific point. This method does not work on anchor elements. The focus will start from the anchor of the element, regardless of the direction.
- node: This is the node within the focus that will be moved
- offset: The offset position within the node where the focus will be moved to. This is the optional parameter. This parameter value by default is 0
Return value: undefined
Example 1: Below the example, The focus is moving backward not forward. This example shows moving the focus from one node to the second node.
Example 2: Below the code, The focus will be moving forward not backward. Let’s see the example.
My Personal Notes arrow_drop_up
Please Login to comment...