user29970 user29970 - 5 months ago 20
HTML Question

Multiple <select> elements

I'm trying to create html (dynamically) which has multiple select elements, but not all of them appear to be displayed. Here's a minimal example:

<html>
<body>
<select/>
<select/>
</body>
</html>


This renders as a single select box in all the browsers I've tried. If I add more selects, I get more select boxes, but never as many as I ask for. Can someone explain what is going on?

Answer

It's because you are not closing the select tag correctly, it should be like this:

<select></select>
<select></select>
Comments