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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:24:19+00:00 2026-06-14T15:24:19+00:00

Assume I have following markup: <div id =About style=height: 2000px> About </div> <div id=Work

  • 0

Assume I have following markup:

<div id ="About" style="height: 2000px">
    About
</div>
<div id="Work" style="height: 2000px">
    Work
</div>

When I run location.hash = 'Work'; the browser jumps right to the position of the “Work” element. I was expecting that behaviour with an anchor tag with a name attribute. But in our case it is a div container with an ID. I tested this in IE8/9 and Chrome.

Why does the browser jumps to the div container when changing the hash?

For your convenience I openend a jsFiddle.

  • 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-14T15:24:20+00:00Added an answer on June 14, 2026 at 3:24 pm

    It is a feature. It is designed so and you can read about it in rfc2854. Let me quote it for you:

    Fragment Identifiers

    The URI specification [URI] notes that the semantics of a fragment
    identifier (part of a URI after a “#”) is a property of the data
    resulting from a retrieval action, and that the format and
    interpretation of fragment identifiers is dependent on the media type
    of the retrieval result.

    For documents labeled as text/html, the fragment identifier
    designates the correspondingly named element; any element may be
    named with the “id” attribute, and A, APPLET, FRAME, IFRAME, IMG and
    MAP elements may be named with a “name” attribute. This is described
    in detail in [HTML40] section 12.

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

Sidebar

Related Questions

Assume I have the following string: Hellotoevryone<img height=115 width=150 alt= src=/Content/Edt/image/b4976875-8dfb-444c-8b32-cc b47b2d81e0.jpg />Iamsogladtoseeall. This
Assume I have the following style table, col1 col2 and col3 have same value
Assume I have the following: <input type=text> <div id=listofstuff> <div class=anitem> <span class=item name>Dog</span>
Assume I have the following CSS: div { -my-foo: 42; } Can I later
Assume I have the following html: <html> <head> </head> <body> <div id=wrapper > <div
Let's assume I have the following structure: <div id=divid1> <div id=divid2> <div id=divid3> </div>
Assume I have the following HTML - <DIV id=ParentDiv> <DIV id=SubDiv1></DIV> <DIV id=SubDiv2> <INPUT
Assume I have the following rules: unify('test', 'this is a test'). run :- write('Enter
Assume, we have following markup: <form> <button type=button id=all>check all</button> <button type=button id=none>check none</button>
Assume I have the following ; def test(): while 1: a = b time.sleep(60)

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.