lundi 27 avril 2020

How can I use conditions in radio buttons (forms)?

I am struggling to find a way how to display information based on two options in a forms. What I mean is, there are two options in "Select Gender". If they choose "Male", then a paragraph should appear. If they choose "Female", then another paragraph should appear on the website. How can I do this?

This is the forms code:

    <form>
            Select Gender
            <br />
            <input type="radio" name="gender" id="male">
            <label for="male">Male</label>
            <br />
            <input type="radio" name="gender" id="female">
            <label for="female">Female</label>
            <br />
            <br />
    </form>

Aucun commentaire:

Enregistrer un commentaire