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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:51:50+00:00 2026-06-14T00:51:50+00:00

I am not sure if this is possible that is why I am on

  • 0

I am not sure if this is possible that is why I am on here asking so if you have any ideas on how this would be possible then I would greatly appreciate it!

Ok say that I have a div that scrolls with overflow-y feature. And say that inside of this div there is a story or large amount of text. Is there anyway to have Javascript memorize or save where you are at in this div maybe through a line number or anchor tag possibly? That way whenever the div is gone, such as if I had javascript change the content of the div, I can prompt the user to click a button and it will return to the spot they were originally at?

I have no approach at this at all! 🙁 The farthest I can think is the simple way of giving each line an anchor tag which is very repetitive and not worth the time and I still wouldn’t know how to get the anchor tag on scroll over.

<div style="overflow-y:scroll;height:200px;"> 

<span id="1">This would</span>

<span id="2">be too</span>

<span id="3"> repetitive and</span>

<span id="4">still dont know</span>

<span id="4">how to save the anchor</span>

 </div>

I was thinking for the javascript maybe something like this.

<a href="#" onclick="document.getElementById('***CURRENTSPOT***').id = 'spot';">Save Spot</a>

Then to reload all they would have to do is click this

<a href="#spot">Load Saved Spot</a>
  • 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-06-14T00:51:52+00:00Added an answer on June 14, 2026 at 12:51 am

    You can try saving the scrollTop property of the parent DOM element and setting that again when the user loads the saved spot.

    Check out this MDN article for more details

    Heres a quick and dirty implementation: http://jsbin.com/ezexaf/1/edit

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

Sidebar

Related Questions

Not sure this is possible, but looking to write a script that would return
Not sure if this is possible but here is what I would like to
I'm not sure if this is possible (complete non-flash developer speaking), but we have
Not sure if this is even possible, but I think it's worth asking. What
I'm pretty sure this is not possible in Zend Framework (I have searched the
I'm not sure whether it's possible or even making sense so I'm asking here.
I'm not sure if this possible but probably is fairly simple. I've made a
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
Not sure if this is possible: I want to use datatables to manipulate my

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.