d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Basic Help > Change Colours On Web Page With A List.
Add Reply New Topic New Poll
Member
Posts: 6,922
Joined: May 16 2011
Gold: 1.00
Jul 27 2014 07:42pm
How would you do this? I can't remember as I learnt about it a couple of years ago.

A drop down list has 5 colours on it, how would I change the colour when I choose a different one on the list.

<Select>

<option id="00FF00">Green</option>
<option id="FFFF00">Yellow</option>
<option id="000000">Black</option>
<option id="A020F0">Purple</option>
<option id="CC3232">Orange</option>

</Select>

That's what it currently looks like.
Member
Posts: 9,412
Joined: Nov 18 2009
Gold: 20.00
Jul 27 2014 08:20pm
There is no way to do this with css/html. You have to use a Javascript/jQuery library or use unordered lists w/ javascript and jquery.

Check this out: http://harvesthq.github.io/chosen/ . It makes select boxes amazing.

And this one is even better: http://ivaynberg.github.io/select2/

This post was edited by PixileDust on Jul 27 2014 08:22pm
Member
Posts: 6,922
Joined: May 16 2011
Gold: 1.00
Jul 27 2014 08:29pm
Quote (PixileDust @ Jul 28 2014 10:20am)
There is no way to do this with css/html. You have to use a Javascript/jQuery library or use unordered lists w/ javascript and jquery.

Check this out: http://harvesthq.github.io/chosen/ . It makes select boxes amazing.

And this one is even better: http://ivaynberg.github.io/select2/


Thanks, I'll check it out when I get home.
Member
Posts: 9,412
Joined: Nov 18 2009
Gold: 20.00
Jul 27 2014 08:32pm
Quote (Fawskeen @ Jul 27 2014 08:29pm)
Thanks, I'll check it out when I get home.


No problem, let me know if you need additional help.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll