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

  • Home
  • SEARCH
  • 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 3285758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:18:10+00:00 2026-05-17T20:18:10+00:00

I’m not a web guy, so this might be something really simple I’m missing,

  • 0

I’m not a web guy, so this might be something really simple I’m missing, but:
Consider the following page:
http://pastehtml.com/view/1bg9qno.html

Which is basically a list of <input>s, and each input has a helper <span> with text (that will change along with the input’s value on keyUp).

So when the list is long enough (like in the above HTML page), if you tab thru the inputs, you will eventually get to the input on the bottom of the page, tab again, and the browser will scroll down to the next input.

In my case, the input has the helper text which is crucial to my app.

The problem is that when the user tabs down to the input that is not visible, the browser only brings that input into the view, and not his entire parent (<div class="item">) which contains the helper text. As a result, this helper text is not visible to the user while he enters stuff in the input.

How can one tell the browser to bring the entire parent into view when focusing the out-of-view input?
Is there any elegant solution?

BTW: This doesn’t happen in Chrome, since Chrome always scrolls down a part-page, but it always happens in Firefox which always scrolls as little as possible to the input.

The HTML looks like this:

<body>
    <div class="item">
        <input type="text" value="text" />
        <br />
        <span>helper text</span>
    </div>
    <hr />
    ...
    <hr />
    <div class="item">
        <input type="text" value="text" />
        <br />
        <span>helper text</span>
    </div>
</body>
  • 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-17T20:18:10+00:00Added an answer on May 17, 2026 at 8:18 pm
    <html>
      <head>
        <script>
          function scrollParentIntoView(elem){
            setTimeout(function(){
               var children  = elem.parentNode.children;
               var lastChild = children[children.length - 1];
               lastChild.scrollIntoView();
               elem.parentNode.scrollIntoView();
               //elem.ScrollIntoView();
             },1);
          }
        </script>
      </head>
      <body>
        ...
        <div>
          <input onfocus="scrollParentIntoView(this);" />
          ...
          <p>end</p>
        </div>
        ...
      </body>
    </html>
    

    I’ve tested on FF and Chrome and seems to do the job – you can see the input and ‘end’ when each ‘…’ is replaced with a dozen
    tags

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
I'm looking for suggestions for debugging... If you view this site in Firefox or
I have a JSP page retrieving data and when single or double quotes are
I have some data like this: 1 2 3 4 5 9 2 6
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.