I have a select box. The options have been styled with different colors via a CSS file that has been referenced. I want to be able to select an option and change the text co
JQuery Code:
$('#mySelect').change(function () { $('#mySelect').css("background", $("select option:selected").css("background-color")); });
This will replace the select's background-color with selected option's background-color.
select
background-color
option
Here is an example fiddle.