1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Active 'Radio Button' Effect

Discussion in 'Web Design & Development' started by TW.87, Feb 4, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. TW.87

    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!
     
  2. Big-K

    Big-K

    Joined:
    Nov 22, 2003
    Messages:
    6,052
  3. TW.87

    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?
     
  4. Big-K

    Big-K

    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';
    }
     
  5. TW.87

    TW.87 Thread Starter

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

    Thank you so much for your help! I really appreciate it.
     
  6. Sponsor

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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/541248

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice