Below is my JSF
<h:selectOneMenu id="lstmonth"
required="true"
value="#{secdeal.month}">
<f:selectItem
itemValue="JAN"
itemLabel="01-January"/>
<f:selectItem
itemValue="FEB"
itemLabel="02-February"/>
<f:selectItem
itemValue="MAR"
itemLabel="03-March"/>
In javascript (In same file)
I want to read the selecteditem's itemLabel's text. (i.e: If I select 01-January, I want the same text into my var x)
x=getElementById('Form:lstmonth').itemLabel // not working x=getElementById('Form:lstmonth').innerText // not working -- returning all months
How to get the itemLabel text? please suggest
Actually I want x=01-January (selected item)