VirtualMV/JavaScript/Forms/RadioButton
From WikiEducator
< VirtualMV | JavaScript
Overview
By the end of this page you will be able to:
|
Radio button (js2_04)
<html><body> <script type="text/javascript"> <!-- function fnCheck() { if (document.frmChoose.radVal[0].checked) { alert("You chose the Add operation");} if (document.myForm.radVal[1].checked) { alert("You chose the Subtract operation");} } //--> </script> <form name="frmChoose"> <p>Select an operation:</p> <p><input type="radio" name="radVal" value="Add" />Add</p> <p><input type="radio" name="radVal" value="Subtract" />Subtract</p> <input type="button" value="Press Me" onClick="fnCheck()" /> </form> </body></html>
Example :Click here to run js2_04.
References
virtualMV | Superquick wiki guide | Please give me some feedback |
VirtualMV/JavaScript/Forms/RadioButton. (2024). In WikiEducator/VirtualMV wiki. Retrieved November 5, 2024, from http:https://wikieducator.org/VirtualMV/JavaScript/Forms/RadioButton (zotero)
|