HTML Radio Button
Overview
HTML Radio button is used when we allow user to select only one option from the many available options.
Syntax
<input type=”radio” name=”rb”> Option1
<br
<input type=”radio” name=”rb”> Option2
<br/>
Example
<html>
<!–
####################################
# HTML Radio Button Demo
# www.TestingDocs.com
####################################
–>
<head>
<title> HTML Tutorials – HTML Radio Button Demo</title>
</head>
<body>
<h1> Sample HTML Form </h1>
<h3> Radio Button Demo </h3>
<p>
Display a sample Radio button:
</p>
<form>
<br/>
<strong>Choose the subject you like the most::</strong>
<br/>
<input type=”radio” name=”rbuttonDemo” value=”Maths”>Mathematics
<br/>
<br/>
<input type=”radio” name=”rbuttonDemo” value=”Physics”>Physics
<br/>
<br/>
<input type=”radio” name=”rbuttonDemo” value=”Chemistry”>Chemistry
<br/>
<br/>
<input id=”submit” type=”submit”/>
<br/>
<br/>
</form>
<p>
<h2>
HTML Tutorials – www.TestingDocs.com
</h2>
</p>
</body>
</html>
Sample Output
—
HTML Tutorials
HTML Tutorials on this website:
https://www.testingdocs.com/html-tutorials/
More Information on HTML:
https://www.w3.org/TR/html401/intro/intro.html