/    Sign up×
Community /Pin to ProfileBookmark

Help with an html link

I was wondering if there was a way to make a link that would refer to code that is the same html document as the link you click.

and I don’t mean the whole “<a href=”#main”></a>” thing that makes the page scroll down when you click the link.

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@rhsundergroundDec 09.2005 — well then could you be more specific as to what you actually want?
Copy linkTweet thisAlerts:
@tribalguyauthorDec 09.2005 — well basicly i'm trying to make a link that could change the content of a frame like using "<a href= target="the target frame I want to use"></a> but instead of the "href" refering to another document, have it refer to more code within the same document.

I'm just not sure if this is possible.
Copy linkTweet thisAlerts:
@pcthugDec 09.2005 — Like <a href="page1.html#main" target="the target frame I want to use"></a>

if this is not what u ment then please explain further
Copy linkTweet thisAlerts:
@welshDec 09.2005 — ok. put this where you want to scroll to:
[code=html]<a name="NAME">Goodies</a>[/code]
and then use this as the link to get there:
[code=html]<a href="#NAME">Go to Goodies</a>[/code]
Copy linkTweet thisAlerts:
@the_treeDec 09.2005 — [b]Welsh[/b]: really, read the first post why don't you?

[b]TribalGuy[/b]: to run a script upon clicking a link use the [i]onclick[/i] attribute like&lt;a href="#" onclick="this.style.color='#fff';"&gt;&lt;/a&gt;
Copy linkTweet thisAlerts:
@CytaelDec 10.2005 — so you've got 2 frames, and you want a link in one to change the color of something in the other frame?

my syntax may be way off here, but you might start with something like
&lt;a href="#" onClick="parent.otherFrameName.object.style.color='#FFF'; return false;"&gt;
×

Success!

Help @tribalguy 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.28,
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,
)...