Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6733535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:46:50+00:00 2026-05-26T10:46:50+00:00

Say I have a list with radio buttons in it. How do I make

  • 0

Say I have a list with radio buttons in it. How do I make it such that hovering over the label will write the value of the radio button into HTML into a <p> tag?

So say it was:

o Option One

Hovering over Option One would write the value of the radio button into a <p> tag below.

My code is below and it won’t work. It should update obviously if the user clicks a different radio button.

function showDegree() {
    var degreeOptions = document.getElementsByName('degree');
    var degreeChoice;
    var i;

    for (i = 0; i < degreeOptions.length; i++) {
        if (degreeOptions[i].checked) {
            degreeChoice = degreeOptions[i].value;
        }
    }

    document.getElementById('degreeOutput').innerHTML = degreeChoice;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:46:51+00:00Added an answer on May 26, 2026 at 10:46 am

    You would have to use an Event, you’re thinking of the word Hover (which is mostly for styling) but in this case you need to think of the word onmouseover (which is for actions… events).

    Let’s say you have this:

    <input type=radio value="val1">Option 1
    <p id=optDisplay></p>
    

    You would have to put in each input the following:

    <input type=radio value="val1" onmouseover="document.getElementById( 'optDisplay').textContent = this.value;">Option 1
    

    Notice that it would only happen when the mouse pointer is over the radio element, that is only the little circle, won’t work if you pointer the text “Option 1”. If you would like to accomplish that you could wrap the input element and the text inside another tag like a span or div which would have to have the onmouseover like this:

    <span onmouseover="document.getElementById( 'optDisplay').textContent = this.firstChild.value;"><input type=radio value="val1"> Option 1</span>
    

    The onmouseover changed a little, as for what you say about “updating” when clicking you don’t have to do anything as if you click it the mouse will be over it, and as long as you don’t pointer any other option it would remain like that.

    It would be a little more tricky to make once clicked prevent any more changes, but thinking quickly you could for example add another event onclick to remove the id of the <P> then after that, if you pointer the other option they wouldn’t find the <P>, no update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a list containing strings that look like this: 00x000s00g00wfds0d dkdf00sdf00sdfg00jk kf00dfjkd0sdl0sd0f0
Lets say I have a list: L = [15,16,57,59,14] The list contains mesurements, that
Say I have a list that contains n lists. Is there a neat way
let's say i have list looking like this: <select name=name id=id> <option value=10176232332>David</option> <option
Say I have a list that holds words and another one that holds confidences
Is it possible to have a Radio button list, like we have a checked
Say I have a list of all Projects , and that I group them
Say I have a list and I want it arranged so that the sum
Say I have a list of member, each of which is a custom object:
Say I have a list of integers: List<int> myInts = new List<int>() {1,2,3,5,8,13,21}; I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.