another newbie question but I am looking to have a radio selection and when selected will bold the items that are associated with the selection. does anyone have any idea on where to look for something like this. I have no clue how to even search for something like this or if it is even possible.
Help?
radio selection turn text bold?
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Have no time to make play with the font style, but main idea (color example) is following
Code: Select all
<form id="cucu" action="test.php" method="post">
<label id="text-1" style="color:#000;">
<input type="radio" name="mumu" onclick="toogle_style();" value="1" />
Test
</label>
<label id="text-2" style="color:#000;">
<input type="radio" name="mumu" onclick="toogle_style();" value="2" />
Test
</label>
</form>Code: Select all
function toogle_style()
{
var label;
var i;
for (i = 1; i <= 2; i++)
{
label = document.getElementById('text-'+i);
if (document.forms.cucu.mumu[i-1].checked)
{
label.style.color = "#f00";
}
else
{
label.style.color = "#000";
}
}
}