2
如何在textarea中顯示經度和緯度。這段代碼似乎有什麼錯誤?謝謝從文本區域獲取輸入
HTML:
Locations:
<select name="ctrTitles" id="ctrTitles">
<option value="1">School</option>
<option value="2">Office</option>
</select>
<textarea name="inputList" id="inputList" cols="50" rows="5" readonly="readonly"></textarea>
<input type="button" value="Proses" onclick="clickedAddList()">
<input id="button2" type="button" value="Calculate" onclick="directions(1, false, false, false, false)">
<input id='button3' type='button' value='Reset' onclick='startOver()'>
JS:
var centerLocations = {}
text1: -9.683075, 124.1241341 - 10.258829, 123.553435 - 10.1965777, 123.5305067,
text2: -9.853080, 124.268283 - 10.115900, 123.809843 - 9.874031, 124.249636
};
$('#ctrTitles').change(function() {
$("inputList").val(centerLocations["text" + this.value]);
}).change();
耶士,謝謝主人。我能做到 –
@DiaanLast檢查演示 – Tushar
大師,如果我點擊按鈕輸入過程如何顯示標記? –