Solved: Active 'Radio Button' Effect

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
I have some content on a website of mine that features a selection of four 'radio buttons' and related text. As the corresponding content for this 'radio button' field is in the form of a quiz-question, only one of the answers is correct.

Is there a simple script available that would allow, when a user selects the correct 'radio button', the answer to become instantly bold?

For example, should the correct answer be the first 'radio button', and the user select the second 'radio button', nothing should happen. Should the user then select the first 'radio button', the text relating to that radio button should become bold to signal the correct answer. Is this possible?

Any help would be greatly appreciated!
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
Thank you for your reply.

Although the script you provided does work in Firefox, it does not work in Internet Explorer 7. Is there a tweak for it that will enable it to work cross-browser?
 
Joined
Nov 22, 2003
Messages
6,052
I forgot that IE dislikes certain lazy methods i sometimes use. Yay for debugging. Here you go, the new functions, you can also get rid of the <style>...</style> bit.

function change(){
var item = document.getElementById('answer');
item.style.fontWeight = 'bold';
}
function unchange(){
var item = document.getElementById('answer');
item.style.fontWeight = 'normal';
}
 

TW.87

Thread Starter
Joined
Dec 29, 2005
Messages
308
That's great!

Thank you so much for your help! I really appreciate it.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top