PseftiS PseftiS - 2 months ago 9
HTML Question

Add html img tag in option text

Is there any way to put img tag in the text of a html option?
For example i need something like this :

<select>
<option value="1"> Text1<img src="foto.png"> </option>
<option value="2"> Text2<img src="foto.png"> </option>
</select>

Answer

An option cannot have any children elements, including img.

Spec: http://www.w3.org/html/wg/drafts/html/master/forms.html#the-option-element

Comments