August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.getSelection()
The getSelection() method returns the text that is selected within the HTML document.
Listing 7.101 uses the getSelection() method to display all captured text in a text box. The result of selecting JavaScript is Great! from the text is shown in Figure 7.7.
<html> The following text area will display any text that you select within the Web page. Try selecting the phrase "JavaScript is Great!" with the mouse. <form name="Form1"> ... |
Read now
Unlock full access