The type
property returns the type of a radio button.
type |
Yes | Yes | Yes | Yes | Yes |
var v = radioObject.type
Type | Description |
---|---|
String | The type of the radio button |
The following code shows how to get the type of the radio button.
<!DOCTYPE html>
<html>
<body>
<input type="radio" onclick="myFunction()" id="myRadio">
<!--from w ww . j a v a 2s. c om-->
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myRadio").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: