/    Sign up×
Community /Pin to ProfileBookmark

making current form input text bold

I have a form with multiple questions the user needs to fill out. There is the question on the left of the page and the text input(or radio, dropdown etc) on the right. When the focus is in the input of a given question, I would like that question text to be bolded. Does that make sense? I’m pretty positive this is done with javascript. And I have searched the forums for this and haven’t found exactly what I am looking for.
Thank you.
Mike

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisMay 23.2007 — <style type="text/css">
.bold {font-weight: 900;}
.norm {font-weight: normal;}
</style>
<span class="norm">How are you today? <input type="text" onfocus="this.parentNode.className='bold'" onblur="this.parentNode.className='norm'"></span><br>
<span class="norm">Do you like chocolate? <input type="text" onfocus="this.parentNode.className='bold'" onblur="this.parentNode.className='norm'"></span>
[size=-1]Disclaimer: This is *not* meant to be a complete example by any stretch of the imagination. Use at your own risk.[/size]
×

Success!

Help @dmikester1 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.17,
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,
)...