2

Is it possible to display an html link inside a multi select box that can be navigated to?

Chris Muench
  • 17,552
  • 67
  • 200
  • 345

3 Answers3

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
  • 104,615
  • 23
  • 192
  • 207
  • 2
    like 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
  • 167,057
  • 51
  • 314
  • 358
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,687
  • 7
  • 37
  • 47