jquery Gets the loop value in the drop down box

  • 2021-07-18 06:42:37
  • OfStack

Without saying much, please look at the code:


<select class="test" id="projectno" name="projectno"> 
  <option value="">&nbsp Please enter your community </option>
  <volist name="cell" id="vo">
  <option value="{$vo['id']}">{$vo['name']}</option>
  </volist>
 </select>

To get the value of the loop, set the default value value to null:

var cell = $.trim($("#projectno").val());


Related articles: