<apex:inputText list="{!listOfStringElements}" id="userInput" onChange="alert(this.value);"></apex:inputText>
In the above code when I select any value from the listOfStringElements I want to call a javascript function. Onchange on the above code works when after selecting the value I click anywhere on the screen but I want to call it as soon as i select any value from the list.