Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Radio

The Radio object represents a check box within an HTML form. A check box is created using the HTML tag and specifying the TYPE attribute as radio. Property/MethodDescription blur()Removes focus from Radio object checkedSpecifies whether a button is checked or unchecked click()Simulates a mouse click on the button defaultCheckedRefers to the CHECKED attribute of the HTML tag focus()Sets the focus to a button formRefers to the Form object that contains the Radio object handleEvent()Invokes the default handler for the specified event nameRefers to the NAME attribute of the HTML tag onBlurEvent handler for Blur event onClickEvent handler for Click event onFocusEvent handler for Focus event typeRefers to the TYPE attribute of the HTML tag valueRefers to the VALUE attribute of the HTML tag <html>     <head>     <title> Example of the Radio object title>     </head>     <body>     <form name="form1">     <input type="radio" name=button1 ?onClick='alert(document.form1.button1.name)'>Box 1     <br>     <input type="radio" name=button2>Box 2     <br>     </form>     </body>     </html>