HTML Forms: Total Domination
Sobre a Aula

The <input type="radio"> creates a radio button in HTML forms, and the peculiarity of this type of input is that, when multiple options are available, the user can select only one of them.

This is similar to tuning a radio, where only one station can be heard at a time.

Thus, radio buttons are often used in situations where it is necessary for the user to make an exclusive choice from a set of options.

Imagine a satisfaction survey form, where the user can choose between “Satisfied,” “Neutral,” or “Dissatisfied.” The use of radio buttons makes it clear that the user should choose only one of these options.

Radio buttons are an excellent choice when it is necessary to limit the user’s choice to a single option, facilitating the collection of specific data and avoiding ambiguities.

By incorporating this type of input into forms, developers improve clarity and precision in information collection, making the user experience more efficient and easy to understand.

See:

<p>Choose your favorite Web language:</p>

<form>
  <input type="radio" id="html" name="fav_language" value="HTML">
  <label for="html">HTML</label><br>
  <input type="radio" id="css" name="fav_language" value="CSS">
  <label for="css">CSS</label><br>
  <input type="radio" id="javascript" name="fav_language" value="JavaScript">
  <label for="javascript">JavaScript</label>
</form>
Entrar na conversa
Rolar para cima