Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:33:25+00:00 2026-05-26T04:33:25+00:00

I create a Range object and then add this Range to selection window.getSelection ().addRange(myRange);

  • 0

I create a Range object and then add this Range to selection

window.getSelection ().addRange(myRange);

How to set the selection direction?
I mean direction which can be checked using the anchorNode, anchorOffset, focusNode and focusOffset properties of selections.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:33:25+00:00Added an answer on May 26, 2026 at 4:33 am

    You can do this on browsers that support the extend() (MDN) method of Selection objects. Mozilla, WebKit and Opera support it; IE does not up to and including version 11. extend() has been added to the HTML Editing APIs spec so it may yet appear in IE.

    Here’s an example function:

    function selectRangeBackwards(range) {
        if (typeof window.getSelection != "undefined") {
            var sel = window.getSelection();
            if (typeof sel.extend != "undefined") {
                var endRange = range.cloneRange();
                endRange.collapse(false);
                sel.removeAllRanges();
                sel.addRange(endRange);
                sel.extend(range.startContainer, range.startOffset);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have create name range on sheet A so I need to use this
I want to create a validation range in cell A1. This validation allow user
Is it possible to create a function which accepts it's parent object as a
I'm trying to create a code which will allow me to ping range of
I've set up a Django project in which i create random points. These random
When I create a named range through the Name Manager, I'm given the option
When I create a graph after using range.copy and range.paste it leaves the paste
I asked this question yesterday about storing a plot within an object. I tried
Greetings, The VBA code below will create an Excel QueryTable object and display it
I am using Aspose.Cells and I have created a Range of cells. This range

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.