44
rated 0 times
[
45]
[
1]
/ answers: 1 / hits: 65573
/ 11 Years ago, tue, march 5, 2013, 12:00:00
I need to scroll through a page using anchor tag
.
Right now I'm doing:
<a href=#div1>Link1</a>
<div id='div1'>link1 points me!!</div>
This works fine when I clicked on Link1, the page scrolls to the div with id div1.
The point is, I do not want to change my URL which takes #div
as suffix once I clicked on Link1
.
I tried with anchor href as
void(0);
and
location.hash='#div1';
return false;
e.preventdefault;
How to avoid changing the URL?
More From » html