jQuery Select Menu Replacement
Posted
by Brad
on Stack Overflow
See other posts from Stack Overflow
or by Brad
Published on 2009-08-02T17:20:25Z
Indexed on
2010/03/31
11:33 UTC
Read the original article
Hit count: 688
I have a select drop-down that selects a theme for the current page the user is on:
<select id="style" name="acct-stylenum">
<option value="1" selected="true">Light</option>
<option value="2">Dark</option>
</select>
Now what I would like to do is add two divs that will also control this select menu. I would much rather have the user select between two images than a select menu. The divs are as follows:
<div class="style-box light"></div>
<div class="style-box dark"></div>
I would like to use jQuery to make the select menu hidden but still use its input. Also I would like the divs to control the menus value and show a selected state. Please let me know the easiest way this can be done using jQuery or JavaScript.
Thanks in advance.
-B
© Stack Overflow or respective owner