Which HTML element should you add?

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?

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?

A.
Rating (Between 1 and 10): <input type=”number” name=”rating” min =”1″ max-“10”>

B.
Rating (Between 1 and 10): <input type=”number” name=”rating” min=”1″ max=”10″
default=”5″>

C.
Rating (Between 1 and 10): <input type=”range” name=”rating” min=”0″ max=”10″
default”=”5″>

D.
Rating (Between 1 and 10): <input type=”range” name=”rating” min=”10″ max=”10″
value=”5″>



Leave a Reply 6

Your email address will not be published. Required fields are marked *

1 × 1 =


freedeveloper

freedeveloper

Well there is a typo in D to be true should be min =1 !! and not min= 10.

Iron

Iron

This answer is wrong, the minimum is not 10!

I’d rather go for ‘C’ – it is the most possible answer.

Alaeddin

Alaeddin

its C , 😉

lex

lex

It’s D except for the typo min 10. There’s no default attribute?

YoYo

YoYo

Plus 1 for what Lex says.

There is only “value” attr for input range, no “default” attr.

The defaultValue does not work in HTML, but only in javascript.

stenly

stenly

looks like typos to me, answer D might be correct ignoring minValue, as default named attribute in range type input element does not exist