spires Posted April 9, 2009 Share Posted April 9, 2009 Hi guys. can any one tell me how to change the colour of a drop down box, once it has been changed? I'm trying to something like this: <select name="price" onchange="background-color: Black"> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> </select> Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/153350-onchange-change-a-drop-down-background-colour/ Share on other sites More sharing options...
Axeia Posted April 9, 2009 Share Posted April 9, 2009 Does this work? <select name="price" onchange="this.style.backgroundColor = 'Black'"> ? Quote Link to comment https://forums.phpfreaks.com/topic/153350-onchange-change-a-drop-down-background-colour/#findComment-805717 Share on other sites More sharing options...
spires Posted April 9, 2009 Author Share Posted April 9, 2009 That's perfect. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/153350-onchange-change-a-drop-down-background-colour/#findComment-805739 Share on other sites More sharing options...
darkfreaks Posted April 9, 2009 Share Posted April 9, 2009 please mark as solved Quote Link to comment https://forums.phpfreaks.com/topic/153350-onchange-change-a-drop-down-background-colour/#findComment-805918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.