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 515939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:40:48+00:00 2026-05-13T07:40:48+00:00

I have an image selector that allows to choose an image from a gallery,

  • 0

I have an image selector that allows to choose an image from a gallery, then fills in the URL into a <input type="text"> field. The URLs can be awfully long, and always seeing the first half of the URL in the text field has very little informational value.

Does somebody know a way to “scroll” to the very right of the text field so that the end of the URL is visible instead of the beginning? Without resorting to a textarea.

  • 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-13T07:40:48+00:00Added an answer on May 13, 2026 at 7:40 am

    All browsers except IE6-8/Opera

    Set HTMLInputElement.setSelectionRange() to the length of the input value after explicitly setting the focus(). The disadvantage is that it scrolls back to start once blurred.

    var foo = document.getElementById("foo");
    foo.value = "http://stackoverflow.com/questions/1962168/scroll-to-the-very-right-of-a-long-text-input";
    foo.focus();
    foo.setSelectionRange(foo.value.length,foo.value.length);
    <input id="foo">  

    All browsers except IE/Opera

    If you don’t care about IE in its entirety, then set Element.scrollLeft to Element.scrollWidth. The disadvantage is the less browser support.

    var foo = document.getElementById("foo");
    foo.value = "http://stackoverflow.com/questions/1962168/scroll-to-the-very-right-of-a-long-text-input";
    foo.scrollLeft = foo.scrollWidth;
    <input id="foo">

    All browsers

    If you’d like to support every single browser, consider to trick it with the dir (direction) attribute which you set to rtl (right-to-left). The disadvantage is that it’s a hack which really need to be taken into consideration when it’s editable and/or you develop a direction sensitive website, but this works on all browsers and is great on readonly inputs.

    var foo = document.getElementById("foo");
    foo.value = "http://stackoverflow.com/questions/1962168/scroll-to-the-very-right-of-a-long-text-input";
    <input id="foo" dir="rtl">  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL for an image (got it from UIImagePickerController) but I no
I have an ImageView that has a drawable image resource set to a selector.
I have a url which contain image address, i want to load that image
OK, I have been working on a random image selector and queue system (so
I have image data and i want to get a sub image of that
I have: image 1:Many imageToTag Many:1 tag I want to issue a query that
I have managed objects that have image properties. Since storing large blobs in CoreData
I have an emote selector that opens up when a user clicks an entry
within a form I have a section that allows the user to build out
I have a drawable state list selector that needs to display a different drawable

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.