jquery - How to get background color for a div from option list items background color -


i have problem. can find codes here: http://jsfiddle.net/icannot/ux8uv5v0/3/

enter code here 

as can see there color schemes. when click 1 of them, colors apply background colors of both of primary , secondary option list items. part works fine.

when select color primary, color should fill box, next list. doesn't. when select color secondary, works. if select primary color, whatever choose, fill box same color of secondary one.

can me please? sorry english.

your jquery selectors not accurate enough. anonymous functions inside change events should be:

$("select#colorlist1 option:selected").each(function (){... ... $("select#colorlist2 option:selected").each(function (){... 

working jsfiddle.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -