Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
Javascript
document.selection.createRange();
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Jeff Thies
#1
document.selection.createRange();
Jul 20 '05, 01:28 PM
Is there a NS7, Opera7 or Mozilla equivalent for:
document.select ion.createRange ();
Jeff
Martin Honnen
#2
Jul 20 '05, 01:28 PM
Re: document.select ion.createRange ();
Jeff Thies wrote:
[color=blue]
> Is there a NS7, Opera7 or Mozilla equivalent for:
>
> document.select ion.createRange ();[/color]
For Mozilla if you want to manipulate the selection in a text control see
Attention Required! | Cloudflare
http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130
If you want to manipulate the selection within text elements then
Mozilla offers the method
var selection = window.getSelec tion();
if (selection.rang eCount) {
var range = selection.getRa ngeAt(0);
}
That range object is a W3C DOM Level 2 Range object, see
Document Object Model Range
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-idl
However the nicest methods surroundContent s and insertNode are still
buggy with Mozilla as far as I know.
--
Martin Honnen
Attention Required! | Cloudflare
http://JavaScript.FAQTs.com/
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment