I just started working with datalist in conjunction with inputs. When creating an option in a datalist, (I’m using Visual Studio Code) the IDE displays an opening and closing option tag. However, according to W3schools, there is no closing option tag in a datalist. This seems inconsistent, or maybe it doesn’t matter either way.
This is defined in the HTML Standard:
An
option
element’s end tag can be omitted if theoption
element is immediately followed by anotheroption
element, or if it is immediately followed by anoptgroup
element, or if there is no more content in the parent element.