If the underlying element collection contains radio buttons, the RadioNodeList.value
property represents the checked radio button. On retrieving the value
property, the value
of the currently checked
radio button is returned as a string. If the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked
state, the empty string is returned. On setting the value
property, the first radio button input element whose value
property is equal to the new value will be set to checked
.
value = radioNodeList.value; radioNodeList.value = string;
var form = document.forms[0]; var radios = form.elements['myRadio']; console.log(radios.value); radios.value = 'Mr.';
Specification | Status | Comments |
---|---|---|
WHATWG HTML Living Standard The definition of 'RadioNodeList' in that specification. | Living Standard | Initial definition. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 34 | 33 (33) | No support | ? | ? |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | 33.0 (33) | ? | ? | ? |
<form>
, <fieldset>
, <input>
elements.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RadioNodeList/value