• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1016
  • Last Modified:

CSS, JS How to BOLD (label) text for Radio button WHEN selected

  <input type="radio" Name="param" value="1" id="param1"
       onChange="if this.value==1 then BOLD" />
     <span id="param1_label"> Param1 </span>

how to bold when this button is selected, and   -->  UNbold when not selected ?


1 Solution
Om PrakashCommented:
<input id="rad1" type="radio" name="rad"><label for="rad1">Radio 1</label>
<input id="rad2" type="radio" name="rad"><label for="rad2">Radio 2</label>

input[type="radio"]:checked+label{ font-weight: bold; }  
 //a label that is immediately preceded by an input of type radio that is checked

willsherwoodAuthor Commented:
perfect,   easy!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now