WBCS.LIVE practice question

What is the primary purpose of the <label> tag in HTML?

Solve this multiple-choice question and check the correct answer with its explanation below.

Answer options

  1. To group multiple input elements
  2. To define a label for an input element
  3. To define a placeholder text for input
  4. To add styles to input elements

Correct answer and explanation

Correct answer: To define a label for an input element