/    Sign up×
Community /Pin to ProfileBookmark

Changing text content with onClick

I’m pretty new to JavaScript and don’t know enough to actually put a code together. I was wondering if there was a way to change the text (about a paragraph) on a page, just by clicking on a link above. For example I would have 3 different links and 3 different paragraphs to go with those links. Instead of creating seperate pages for each one, I wanted the paragraphs to switch out depending on which link you press. Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Jul 31.2008 — You want a tab system. A member of this forum wrote one [url=http://www.webdeveloper.com/forum/showthread.php?t=94183&highlight=accessible+dhtml+tabs]Accessible HTML Tabs[/url], and a google search for "javascript tabs" will reveal tutorials (if you are interested in learning how to do it too, look at the tutorials) and plenty of samples.

The one thing with any tab system is to make sure they work with JavaScript disabled. Be wary of that.
Copy linkTweet thisAlerts:
@Drem333authorJul 31.2008 — Thanks a lot. That will definitely work!
×

Success!

Help @Drem333 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 6.1,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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