/    Sign up×
Community /Pin to ProfileBookmark

Using JavaScript for Anchors

Is there a way to use Javascript for anchors? Like having this:

[CODE]
<a name=”bottom”>Go to the bottom</a>
[/CODE]

Then having a small script link to that? Thanks for any help.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@felgallJun 09.2007 — location.href = '#bottom';
Copy linkTweet thisAlerts:
@rootJun 09.2007 — far simpler to just us HTML
[code=html]<a href="#bottom">goto bottom</a>[/code]
then those who dont have JS will still be able to get to the bottom of things...
Copy linkTweet thisAlerts:
@AscendancyauthorJun 16.2007 — Well the reason I asked was to see if there was a way so that the URL wouldn't change to http://whatever.com/page.html#bottom
×

Success!

Help @Ascendancy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...