What is the correct HTML code to create a checkbox input field?

  • A<input type="text" value="checkbox">
  • B<input type="checkbox">
  • C<input type="radio" name="checkbox">
  • D<input type="button" value="checkbox">
Show answerHide answer

Correct answer B

The HTML code <input type="checkbox"> is used to create a checkbox input field. This allows users to select or deselect options by checking or unchecking the box.