Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Radio name

The name property represents the NAME attribute of the HTML tag that creates the Radio button. This allows you to reference a Radio object directly by name. <html>     <head>     <title> Example of the radio name property</title>     </head>     <body>     <form name="form1">     <input type="radio" name=myButton>Box 1     <br><br>     <input type="button" value="Get Name" onClick='alert("The name of the button is: " +             document.form1.myButton.name)'>     </form>     </body>     </html>