0
我有一個JSON對象:mootools的JSON選擇列表
var data = {"options" :[
{"name": "Size", "value": "S", "price": "10", "order": "1"},
{"name": "Size", "value": "M", "price": "12", "order": "2"},
{"name": "Size", "value": "XL", "price": "14", "order":"3"},
{"name": "Color", "value": "Red", "price": "14", "order":"2"},
{"name": "Color", "value": "Green", "price": "12", "order": "1"}
]}
我如何轉換這種使用mootools的javascript庫選擇列表?
<div>
<label>Size:</label>
<select name="options[size]">
<option value="10">S</option>
<option value="12">M</option>
<option value="14">XL</option>
</select>
<label>Color:</label>
<select name="options[color]">
<option value="12">Green</option>
<option value="14">Red</option>
</select>
</div>
謝謝!