Identify the error in the following HTML code: <HTML> <BODY> <FORM ID =…

2022

Identify the error in the following HTML code:

<HTML>
<BODY>
<FORM ID = "FORM1" METHOD = POST>
<BR> SELECT YOUR FAVOURITE CHANNEL :
NETFLIX <INPUT TYPE = CHECKSELECT>
AMAZON PRIME <INPUT TYPE = CHECKSELECT>
</FORM>
</BODY>
</HTML>

Statements:

(A) CHECKBOX should be used instead of CHECKSELECT.

(B) METHOD = GET should be used instead of POST.

Answer: A. Only (A) is correctConcept: An HTML <input> element's type attribute only accepts a fixed, pre-defined set of values (checkbox, radio, text, submit, etc.); a form's method…

  1. A.

    Only (A) is correct

  2. B.

    Both (A) and (B) are correct

  3. C.

    Only (B) is correct

  4. D.

    The code is correct and has no errors

Attempted by 419 students.

Show answer & explanation

Correct answer: A

Concept: An HTML <input> element's type attribute only accepts a fixed, pre-defined set of values (checkbox, radio, text, submit, etc.); a form's method attribute accepts either GET or POST, and both are equally valid ways to submit a form — neither one is a required correction over the other.

Application: In the code, <INPUT TYPE=CHECKSELECT> uses CHECKSELECT, which is not one of HTML's valid input types — this is the actual defect, and it should be written as type="checkbox". The rest of the markup is standard: <FORM ID="FORM1" METHOD=POST> uses a legal id attribute and a legal METHOD=POST value.

Cross-check: Statement (A), "CHECKBOX should be used instead of CHECKSELECT," matches this real defect exactly. Statement (B), "METHOD=GET should be used instead of POST," proposes a change to a value that was never wrong, so it does not describe an actual error.

Final answer: Only statement (A) is correct.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…