title: How do i change the color of <h:selectOneMenu> Dropdown menu on selecting an entry in JSF?
body: <p>This is a sample code:</p>
  
  <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:a4j="http://richfaces.org/a4j"
   xmlns:rich="http://richfaces.org/rich"&gt;
  &lt;script type="text/javascript" src="js/DataTable.js"&gt;&lt;/script&gt;
  &lt;h:body&gt;
  &lt;h:selectOneMenu value="test1"
  styleClass="combobox" id="profileID"&gt; 
  &lt;f:selectItem itemLabel="--Select--" itemValue="--Select--"/&gt;
  &lt;f:selectItem itemLabel="Yes" itemValue="Yes"/&gt;
  &lt;f:selectItem itemLabel="No" itemValue="No"/&gt;
  &lt;/h:selectOneMenu&gt;
  &lt;/h:body&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Now when i select an option, i want the minimized dropdown menu rectangle to change it's background color, highlighting the selected option.If i choose 'Yes', the rectangle should turn 'Green', if i select 'No', the rectangle should turn 'Red'. How can this be implemented?</p>