![]() |
jquery - change backround color of html select options
I have this html code
PHP Code:
PHP Code:
Any ideas how to change all the option background colors to white when the select box is clicked? |
Should be working for you.
I suggest you change onClick="clearSelect..... to onchange="clearSelect..... in the select tag. |
First of all, this is a pretty – well – “uncommon” way to do it. Secondly, try to style the
option elements rather than the select. And try to separate function and style a little more. For example, don’t change CSS with JavaScript, use JS to add a class to the element and style that class with CSS in the stylesheet.So, for example: Code:
function clearSelect(thisfield, id) {Code:
.cleared { |
| All times are GMT +1. The time now is 02:37 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.