title: How to get the value of selectOneMenu by using clientId in Javascript Method?
body: <p>I have a datatable which contains selectOneMenu. I want to get selected value of selectOneMenu in my Javascript method by using clientId. I have tried with this following code..</p>
  
  <pre><code> &lt;p:dataTable var="name" value="#{model.nameList}" rowIndexVar="rowIndex"&gt;
  &lt;p:selectOneMenu id="selector_#{rowIndex}" onchange="select(#{rowIndex});"&gt;
              &lt;f:selectItem itemLabel="Select" itemValue=""&gt;&lt;/f:selectItem&gt;
              &lt;f:selectItem itemLabel="Month" itemValue="Month"&gt;&lt;/f:selectItem&gt;
              &lt;f:selectItem itemLabel="Week" itemValue="Week"&gt;&lt;/f:selectItem&gt;
          &lt;/p:selectOneMenu&gt;
  &lt;/p:dataTable&gt;
  
  &lt;script type="text/javascript"&gt;
      function select(rowIndex){
          selector = "selector_" + rowIndex;
          var element = $("select[name$=" + selector +" option:selected").val();
  
          alert(element);
      }
  &lt;/script&gt;
  </code></pre>
  
  <hr>
  
  <p>I need two values in javascript method, rowIndex and the selected value of selectOneMenu</p>