Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the page load to an anchor tag?

Tags:

anchor

tags

how could I, or is it possible, to make it so when the webpage loads, the first thing it shows you is the part of the page, where the anchor tag is you want the person to first see.

Is it possible?

Thanks for all help in advance.

like image 463
user2178586 Avatar asked May 03 '13 21:05

user2178586


People also ask

How do I link to an anchor in a page?

In the URL field, enter the # hashtag symbol, followed by the name of the anchor. If you want to link to an anchor on an external page, you can enter the full URL, then the # hashtag symbol, followed by the name of the anchor.

How do I refresh a page using anchor tag?

After you set the specified URL into location, issue window. location. reload(true) . This will force browser to reload the page.

How do I link to an anchor to another page in HTML?

You need to use the href attribute to link to another page. The value of the href attribute is usually a URL pointing to a web page (like the one above). You can also link another HTML element or a protocol (for example, sending email), and you can execute JavaScript using the href attribute.


1 Answers

Something simple like this would do it

<body onload=' location.href="#myanchor" '>
<a id='myanchor' href='#'>anchor text</a>
like image 143
Kevin Lynch Avatar answered Oct 12 '22 06:10

Kevin Lynch