/    Sign up×
Community /Pin to ProfileBookmark

Hello

First time post, need some help, total newbie but heres what I need:

Javascript code that will change an external style sheet so that the main text of the page can be changed to large or small text by clicking on two radio buttons named ‘enlarge’ and ‘reduce’. The example function i was give is down below but how do I get the bloody thing to work???

function enlarge(){
document.getElementById(“csslink”).href = “dom_acc.css”;
}
function reduce(){
document.getElementById(“csslink”).href = “dom.css”;
}

Help!
Cheers

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@lcscneDec 12.2003 — I don't think this is possible. The page needs to be reloaded after the link href has been changed. Simply changing the href isn't going to automatically implement the new style sheet without a page reload.
Copy linkTweet thisAlerts:
@fredmvDec 12.2003 — It's completely possible. See attachment.

[upl-file uuid=dd6d2fe9-8652-42cb-83b3-b7e6d033f231 size=921B]style.zip[/upl-file]
Copy linkTweet thisAlerts:
@slam2004authorDec 15.2003 — thanks fred!!! Works a treat ?
Copy linkTweet thisAlerts:
@fredmvDec 15.2003 — You're quite welcome. ?
×

Success!

Help @slam2004 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.2,
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,
)...