/    Sign up×
Community /Pin to ProfileBookmark

Text Box below link

I’m wondering if anyone knows what the code is for my situation. I would like to have a link, that once clicked opens a box below it with text. Any suggestions?

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@Daniel_TJul 14.2004 — <!-- in <head> -->
<script type="text/javascript">
window.onload=document.getElementByID('text').display=none;
</script>

<!-- wherever you want the textbox/link to be on the page -->
<a href="javascript:document.getElementByID('text').style.display=block;" title="make the text appear!">Show text!</a>
<div id="box">This text appears when the link is clicked.</div>

Note that this uses Javascript, so it is not recommended for situations in which the text MUST be invisible before the link is clicked. If the user has Javascript disabled, the text will always be visible, even without the link being clicked.

-Dan

[b]**EDIT**[/b]

There should not be a space between [i]java[/i] and [i]script[/i] in the word [i]javascript[/i]. These forums have a bad habit of putting in spaces where there shouldn't be any. :mad:
×

Success!

Help @jonathanhou 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...