Q:

How populate a select tag in HTML to JSF 2? 

I have this code which works fine in HTML as you can see, but how get the values of the <select /> tag to insert in my bean ? 
Something like this:
<h:outputLabel for="state" value="State:" />
<h:selectOneMenu id="state" value="#{bean.state}" />

I'm trying a lot of things but nothing so far. 
Any idea ? 

A:

This isn't going to work.  JSF needs to know about all of the dropdown items.  
Either use a plain HTML <select> element instead of <h:selectOneMenu> and grab the submitted value by @ManagedProperty or <f:viewParam>, or port that JS code to JSF backing bean code so that you can use <f:selectItems>.  You can use <f:ajax> to fill and render the 2nd dropdown.