![]() |
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 Selection.removeRange() method removes a range from a selection. Syntax: removeRange(range); Parameters: This method has one parameter only.
Return value: This method returns undefined. Example 1: The following code adds some texts and removes the selection by using the removeRange() method. HTML
Output: ![]()
Example 2: The following code selects some texts by using the selectNodeContents() method and removes the selection by using the removeRange() method. HTML
Output: ![]()
Reference: https://developer.mozilla.org/en-US/docs/Web/API/Selection/removeRange |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |