Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Radio form

The form property references the Form object that contains the Radio box. <html>     <head>     <title> Example of the radio form property</title>     </head>     <body>     <form name="form1">     <input type="radio" name=button1>Box 1     <br>     <input type="radio" name=button2>Box 2     <br><br>     <input type="button" value="Get Form Name"       onClick='alert("The form name is: " + document.form1.button1.form.name)'>     </form>     </body>     </html>