TOC PREV NEXT INDEX

Put your logo here!


window.getSelection()


Returns the selection (generally text).

Syntax

selection = window.getSelection() 

Parameters

selection is a selection object.

Example

function cutThis() { 
  text = window.getSelection(); 
  if len(text) 

Notes

The selection object returned by this method is automaticall converted to a string as needed. But you can also get the ranges in the selection and you can navigate through the selected nodes using these range objects.

See the nsISelection interface in mozilla for more information about selection objects and the services they provide for manipulating selections.

Specification

DOM Level 0. Not part of specification. 


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX