Is it possible to display an html link inside a multi select box that can be navigated to?
Asked
Active
Viewed 2.6k times
2
-
2"No", but you can workaround the limitation. (sup jQuery) – thirtydot Mar 21 '11 at 19:45
3 Answers
6
You could use the value attribute to store the url
<select >
<option value="www.yahoo.com">yahoo</option>
...
</select>
have use javascript to retrieve the value when an item is selected and redirect to that URL.

Bala R
- 107,317
- 23
- 199
- 210
-
2like so `$("select.quickNav").change(function(){ if ($(this).val()!='') { window.location.href=$(this).val(); } });` – CloudMagick Sep 05 '12 at 22:12
1
Yes and no.
You cannot make a link inside a select
element, however you can make a select element that will change the page when an option is selected. (Probably not what you want)
Additionally, you can make your own pseudo-select box using a combination of input:radio
elements, CSS, and JavaScript. This pseudo-select box can be customized to contain anchor elements and other such things if needed.

zzzzBov
- 174,988
- 54
- 320
- 367
1
You can try to add an onClick event into the option button that will behave like an anchor tag.
<select multiple>
<option onClick="window.location = 'http://www.google.com'" >google</option>
<option onClick="window.location = 'http://www.stackoverflow.com'">stackoverflow</option>
</select>

ace
- 6,775
- 7
- 38
- 47