/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Making a link bold if condition met..

I have an if clause in a script, and, if its condition is met, I want to make a link bold as a result.

if (some_condition) {
What goes here to make the following link bold (i.e. font-weight now 800)?
}

<a href=”some_link” style=”font-weight:400;” id=”control”>some text</a>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Jan 18.2008 — You would either have to call it onload or after the element has been rendered on the page.

document.getElementById("linkId").style.fontWeight = "bold";

Eric
Copy linkTweet thisAlerts:
@gil_davisJan 18.2008 — <i>
</i>document.getElementById("control").style.fontWeight = 800;
Copy linkTweet thisAlerts:
@cgm225authorJan 18.2008 — Thank you so much!
×

Success!

Help @cgm225 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.19,
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,
)...