i have elements like this on page
<a href="#hi">go to hi</a>
.
.
<a name="hi">hi text here</a>
but i would like users go to “hi text here” at first on page loading. how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I’d suggest that you first test for another hash before moving your users’ browser to focus another element:
JS Fiddle demo.
Incidentally, you can use the hash (the part after the
#in the URL) to jump to any element that has anid, you don’t need to use the named-anchors (<a name="hi">...</a>).