how can i change the color and the font type to bold when the checkbox is oncheck?

<script type="text/javascript" language="javascript">
function colorBlack(e2) {
var radgroup = document.getElementsByName(;
for (var r=0; radgroup[r]; ++r) 
radgroup[r] = radgroup[r].checked ? 'black' : 'red';

this is the code to change the color but i dunno how to change the text to bold..
can u all help me please? thank you


Use font-weight:

radgroup[r] = radgroup[r].checked ? 'bold' : 'normal';