I was trying to insert images in a drop down list. I tried the following code but its not working. What is the best way to achieve this?
<select>
<option value="volvo"><IMG src="a.jpg"HEIGHT="15" WIDTH="15" BORDER="0"align="center">Volvo</option>
<option value="saab"><IMG src="b.jpg"HEIGHT="15" WIDTH="15" BORDER="0"align="center">Saab</option>
<option value="mercedes"><IMG src="c.jpg"HEIGHT="15" WIDTH="15" BORDER="0"align="center">Mercedes</option>
<option value="audi"><IMG src="d.jpg"HEIGHT="15" WIDTH="15" BORDER="0"align="center">Audi</option>
</select>
folks, I got this Bootstrap dropdown working. I modified the click event slightly in order to keep the currently-selected image. And as you see, the USD currency is the default selected :
You can't do that in plain HTML, but you can do it with jQuery:
This code will work only in Firefox:
Edit (April 2018):
Checkout And Run The Following Code. It will help you...
I have found a crossbrowser compatible JQuery plugin here.
http://designwithpc.com/Plugins/ddSlick
probably useful in this scenario.
You need to achieve that using CSS
http://binnyva.blogspot.com/2006/01/icons-for-select-menu-options-in.html