1

how would I transform the below code into a <select> <option> drop down? Currently when I select any one of the links below it filters out a list only showing the selected items.

<span>Filters:</span>
<a class="button" href="#all">All</a>
<a class="button" href="#settings">Settings</a>
<a class="button" href="#categories">Categories</a>

trying to do something like this

<select>
<option class="button" href="#all">All</option>
<option class="button" href="#settings">Settings</option>
<option class="button" href="#categories">Categories</option>
...
acctman
  • 4,229
  • 30
  • 98
  • 142
  • I find that the standard dropdownlist is very limited when it comes to anything beyond standard option elements. You might want to look at third party dropdowns for this – TGH Apr 25 '12 at 04:22
  • You are missing the JavaScript attached to the ``. – iambriansreed Apr 25 '12 at 04:32
  • 2
    maybe this might help you: http://stackoverflow.com/questions/2000656/using-href-links-inside-option-tag – Andrei Sfat Apr 25 '12 at 05:08

3 Answers3

1

jQuery's .change() may help you.

http://api.jquery.com/change/

C. Leung
  • 6,218
  • 3
  • 20
  • 32
1

Why not add an onClick event to your option elements?

just set the location.href to your required value inside every onclick.

Shashank Kadne
  • 7,993
  • 6
  • 41
  • 54
1

If i understand it correctly you want your link to behave like a select box. http://jsfiddle.net/aatZJ/1/

Bob
  • 1,489
  • 1
  • 16
  • 28