Programming in HTML5 with JavaScript and CSS3 — Question 4

You are developing an HTML5 web form to collect feedback information from site visitors.
The web form must display an INPUT element that meets the following requirements:
✑ Allow numeric values between 1 and 10.
✑ Default to the value of 5.
✑ Display as a slider control on the page.
You need to add the INPUT element to the form.
Which HTML element should you add?

Answer options

Correct answer: C

Explanation

The correct answer is option C because it uses the 'range' type, which allows for a slider control, and it specifies a numeric range between 1 and 10 with a default value of 5. Option A and D incorrectly use 'number' type, which does not create a slider. Option B does not set the default value correctly, as it uses 'value' instead of 'default'.