1
正在試驗節點Js。你如何創建一個動態的下拉菜單? 謝謝。如何在NodeJS中創建動態下拉菜單?
正在試驗節點Js。你如何創建一個動態的下拉菜單? 謝謝。如何在NodeJS中創建動態下拉菜單?
<div class="control-group">
<%- form.label("state_or_province", false, {class: "control-label"}) %>
<div class="controls">
<!-- <%- form.input("state_or_province") %> -->
<select id="Facility_state_or_province" name="Facility[state_or_province]" size="1">
<% state_or_province_list.forEach(function (state_or_province_entry) { %>
<option value = "<%= state_or_province_entry.lookup_code %>" <%= (facility.state_or_province != null) && (facility.state_or_province == state_or_province_entry.lookup_code) ? 'selected = "selected"' : '' %>><%= state_or_province_entry.meaning %></option>
<% }); %>
</select>
</div>
</div>
哇。那很快!效果很好。 – mukama