Radio.checked
JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax
radio.checked
Description
The checked property of the Radio object is a Boolean value used to determine whether a radio button is in a checked or unchecked state.
Example
Listing 7.432 shows an example of how to determine whether the radio button is checked by using the checked property.
Listing 7.432 Example of the checked Property
<html> <head> <title> Example of the radio checked property</title> </head> <body> <script language="JavaScript"> <!-- Hide // function looks to see if button 1 is checked and displays // an appropriate alert message. function checkButton(){ if(document.form1.button1.checked == true){ alert("Box1 is checked"); } else if(document.form1.button2.checked ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.