HTML Radio Button | HTML Radio Group Tutorial By Web Designing House ( WDH)

HTML Radio Button


There are 3 button options and for connection, they use the name attribute, which is the main purpose of a Radio button to work get together and allow only one option. The name Attribute should be the same identical name in this example all button has only name=”gender”.

<!DOCTYPE html>
<html>
    <body>

    <h1>HTML Radio Button</h1>

    <input type="radio" name="gender" value="male"> Male<br>
    <input type="radio" name="gender" value="female"> Female<br>
    <input type="radio" name="gender" value="other"> Other
    </body>
</html>

Output: In a GIF, you can see only one option can select.