Jump to content

Using JS to go to a target on a page?


grippat

Recommended Posts

Another way might be to set the location.href property.
location.href = location.href + '#bottom';

Or location.hash = "#bottom".You need an anchor called <a id="bottom"> for it.
Link to comment
Share on other sites

Or just

<a href="#lower">Click to go lower</a><!.. Somewhere lower down on the page --><a id="lower"></a>

There! No need for JS.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...