I want to add more than 255 images in a dropdown menu, I did this but it does not show the image, if someone helps me I appreciate it.
<table>
<tr>
<td>Modificar Porcentaje de dificultad:</td>
<td>
<select name="percent">
<option value="100">
<a class="back" href="images/anillo.png"></a>
</option>
<option value="100">
<a class="back" href="images/utileria.png"></a>
</option>
<option value="100">
<a class="back" href="images/joyeria.jpg"></a>
</option>
</td>
</tr>
</table>
As I put you (and they put you) in other comments and answers, to do what you want you will need to change your HTML or use some kind of JavaScript/jQuery plugin. You already have a solution with JavaScript, I'm going to give you an alternative using only HTML and CSS, without any JavaScript code.
The idea is to have a series of radio buttons and labels (which will activate/deactivate those buttons). And if you want multiple selection to be allowed, you could use checkboxes instead of radio.
Here is an example of how it could be done:
Based on stack over flow's answer in English:
It will never work, since you deliver an
href
image to a label<a>
, you must give<option>
the image, try this:In the answer to which I referred, they also explain how to achieve this at the level of
css
, however, I doubt it will help you since you have more than 255 images which they want to list in a selector.EDITION
As @blonfu commented, not in all browsers it is possible to perform this action that simple, it is best to create and occupy other html elements to get the result you expect, this code can help you start, obviously by modifying css!