Trace
Trace

Reputation: 18869

Is div within select valid?

Is it valid to add a div within select tags?

Using Marionette, I have a compositeview that uses "select" as an itemViewContainer.
The options are dynamically loaded from the server.
In case no options are available, I want to load an emptyview instead using div (no option).

Is it valid to load a div as emptyview within the select?

Upvotes: 0

Views: 76

Answers (1)

David Thomas
David Thomas

Reputation: 253318

No; the only valid child elements of a <select> element are <option> or <optgroup> elements; <div> elements are not permitted; not even if you try to wrap them inside of an <option> (which can contain only text).

References:

Upvotes: 5

Related Questions