highlighted text




JavaScript Source Code 3000: Page Details: Highlighted Text








































Highlighted Text







Captures any text that has been highlighted with the cursor. In Internet Explorer, it even grabs text highlighted within a text box or textarea. Sweet!






Highlight any text on the page and JavaScript will 'capture'
it in the textbox below. Internet Explorer also allows for
the capture of text highlighted within a textbox or textarea:
Here's two to try out:

or or highlight me!


Selected text:






JavaScript Source Code 3000: Page Details: Highlighted Text
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- TWO STEPS TO INSTALL HIGHLIGHTED TEXT:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: JavaScript Source Code 3000 -->

<! >
<! >

<!-- Begin
var text = "";
function getActiveText(e) {

// Sets text MSIE or Netscape active
// text based on browser, puts text in form
text = (document.all) ? document.selection.createRange().text : document.getSelection();

document.theform.text.value = text;
return true;
}

document.onmouseup = getActiveText;
if (!document.all) document.captureEvents(Event.MOUSEUP);
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form name=theform>
Selected text: <input type=text name=text value="">
</form>
</center>



<!-- Script Size: 1.12 KB -->










Wyszukiwarka

Podobne podstrony:
text highlighter
java text FieldPosition
java text CollationElementIterator
song23 Elektryczne gitary Dzieci text tab
Coolio Geto Highlites
Lesson Plan 099 Text
1c Eurasia domina text sub
Lesson Plan 084 Text
Lesson Plan 114 Text
assignments view done text
Lesson Plan 075 Text
Lesson Plan 012 Text
Text
text
Lesson Plan 083 Text
text Xenophon

więcej podobnych podstron