how to know which radio button is selected out of all options?

Shreyans.-Systematix

I am having a list of questions and for each question having 4 options. Now I want to know, which radio button is checked ?

Ben Rhys-Lewis

If the radio buttons have ids you could use:

if (document.getElementById('radioId').checked){
    //do something
}

If you have loads of them you could use:

var radioButtons = document.getElementsByName('radioButtonName');

To get all the radio buttons that have that name field and then loop through them all with a for loop with an if statement to see if they are checked inside.

for(i=0;i<radioButtons.length;i++){
    if(radiobutton[i].checked){
        //do something
    }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to know which radio button is selected in jquery?

From Dev

how to know which radio button id selected of which row?

From Java

How can I know which radio button is selected via jQuery?

From Dev

How to find out which radio button the user selected in Javascript?

From Dev

How to check which radio button is selected if they're all runat server?

From Dev

How to check which radio button is selected if they're all runat server?

From Dev

How to retrieve which radio button within a LI is selected

From Dev

How to swap the displayed image based on which radio button is selected?

From Dev

How to disable buttons based on which radio button is selected?

From Dev

How to know which button the user selected on <paper-dialog>?

From Dev

How to know which button the user selected on <paper-dialog>?

From Dev

How to find out which radio button chosen by the user

From Dev

How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

From Dev

JQuery how to know out of all select which has lost focus

From Dev

How to know which imageview is selected

From Dev

How to style selected radio button

From Dev

TKinter selecting first radio button sets all others to selected and greyed out

From Dev

check all radio list radio button has been selected or not on gridview

From Dev

How can I tell which radio button is selected with node.js

From Dev

How to get list of values which are selected in radio button after click on submit in Angular js

From Dev

how to check if input field has filled out and radio button has been selected

From Dev

Iterating through the radio button group and prepare a string of selected options

From Dev

How do I know which value is selected

From Dev

How to check if radio buttons are selected on button click?

From Java

How to get value of selected radio button?

From Dev

How to check if the radio button is selected or not in Selenium WebDriver?

From Dev

How to get value of selected radio button in angularjs

From Dev

How To get Selected Radio Button Value in Mvc

From Dev

How to display a radio button selected using a variable?

Related Related

  1. 1

    How to know which radio button is selected in jquery?

  2. 2

    how to know which radio button id selected of which row?

  3. 3

    How can I know which radio button is selected via jQuery?

  4. 4

    How to find out which radio button the user selected in Javascript?

  5. 5

    How to check which radio button is selected if they're all runat server?

  6. 6

    How to check which radio button is selected if they're all runat server?

  7. 7

    How to retrieve which radio button within a LI is selected

  8. 8

    How to swap the displayed image based on which radio button is selected?

  9. 9

    How to disable buttons based on which radio button is selected?

  10. 10

    How to know which button the user selected on <paper-dialog>?

  11. 11

    How to know which button the user selected on <paper-dialog>?

  12. 12

    How to find out which radio button chosen by the user

  13. 13

    How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

  14. 14

    JQuery how to know out of all select which has lost focus

  15. 15

    How to know which imageview is selected

  16. 16

    How to style selected radio button

  17. 17

    TKinter selecting first radio button sets all others to selected and greyed out

  18. 18

    check all radio list radio button has been selected or not on gridview

  19. 19

    How can I tell which radio button is selected with node.js

  20. 20

    How to get list of values which are selected in radio button after click on submit in Angular js

  21. 21

    how to check if input field has filled out and radio button has been selected

  22. 22

    Iterating through the radio button group and prepare a string of selected options

  23. 23

    How do I know which value is selected

  24. 24

    How to check if radio buttons are selected on button click?

  25. 25

    How to get value of selected radio button?

  26. 26

    How to check if the radio button is selected or not in Selenium WebDriver?

  27. 27

    How to get value of selected radio button in angularjs

  28. 28

    How To get Selected Radio Button Value in Mvc

  29. 29

    How to display a radio button selected using a variable?

HotTag

Archive