If the browser supports a Selection object or TextRange objects, you may then be able to access the selected text using JavaScript. Of course in a form object, the text of the whole object can also be accessed, but this may not be what was selected because the user may select all or part of a page and that selection may span several form elements or only part of a form element.
Unless you call this method, the bounded area of the TextRange object will not be visible to the user.
Prev | Home | Next |
TextRange.queryCommandValue() | Up | TextRange.setEndPoint() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |