Confusion about text between option tags in Dropdown list and Datalist in HTML

I was wondering about the text input between the option tags. in dropdown list, we have to add values in opening option tag and text also between the option tags for rendering that option. If we don’t add any text, add only values, it don’t render anything, just blank space.
But in the datalist, if we just add the value to the option tag without any text between the option tags, it renders the valuse as a option and if we add text too,it also renders that. there’s no binding to add any text between the option tags in datalist while we have to do that for dropdown list option tags. What’s the point here?

If you put text between <option> tags when using a <datalist>, it renders it a sort of a description. I think the reason for this is that you don’t have to select a pre-given option-you can write your own option in there.

1 Like

Yeah, that’s what I thought. It’s the close enough explanation. Thank you.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.