HTML <Radio> Tag

The HTML <Radio> button is used to define the small circles, which are highlighted when selected. It is a form element which allows the users to select only one option from the given set of options.

It is created by the type attribute of the <input> element as shown in the following syntax:

<input type="radio" name ="Any_name"/>

Example

html>  

<head>  

</head>  

<title> Example of Radio Button</title>  

<body>  

<form>  

    

<label>  

Gender:   

</label>  <br>  

<input type="radio" id="gender" name="gender" value="male"/> Male    

<br>  

<input type="radio" id="gender" name="gender" value="female"/> Female <br/>   

</form>    

</body>  

</html>

Output:

html radio tag

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *