CD-383Appendix F . Examples from Parts III and (Web hosting faq)
Wednesday, December 26th, 2007CD-383Appendix F . Examples from Parts III and IV if (document.selection) { document.forms[0].selectedText.value = document.selection.createRange().text event.cancelBubble = true } } } if (isNav4) { document.captureEvents(Event.MOUSEUP) } document.onmouseup = showSelection
Getting Selected Text
Select some text and see how JavaScript can capture the selection:
ARTICLE I
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the government for a redress of grievances.