Aaron said:
In theses JavaScript WYSIWYG editors
Any one in particular?
how do they determine if and where
there is marked (highlighted) text ?
Do you mean selected text? If not, what do you mean by "highlighted"?
If you mean selected text, then the text selection functionality, and
indeed the basic editor functionality, is not provided by JavaScript at
all, but by the browser itself.
The browsers vary as to their implementations of WYSIWG (or rich-text)
editing, with Internet Explorer and Firefox perhaps being the most
advanced at present.
You can access the selection, and can access various editor commands,
through host objects exposed to JavaScript by the browser.
For instance, Internet Explorer has the "document.selection" and
"TextRange" objects, using which you can access the current selected
text, and execute commands, such as apply bold.
Firefox (and Mozilla) have their own selection object:-
E.g. see
<URL:
http://developer.mozilla.org/en/docs/window.getSelection>
Hope that helps.
Regards
Julian Turner