我正在根据一些 Json 数据开发计算器输入的值未定义
这就是我的代码的样子
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form action="" id="my-form">
<div class="form-group">
<label for="">Enter Lat</label>
<input type="text" id="lat" step="any">
<label for="">Enter Long</label>
<input type="textr" id="long" step="any">
</div>
<input type="button" id="Btn" value="Calculate" >
<h2 id="result">result</h2>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
var desiredLat = document.getElementById("lat").value,
desiredLong = document.getElementById("long").value;
const
myData = {
"datagrid": [
{ "GRIDCODE": 1735,"lat": 35.91511132, "long": -5.401484264 },
{ "GRIDCODE": 1805, "lat": 35.90677815, "long": -5.468149593 },
{ "GRIDCODE": 1808, "lat": 35.90677815, "long":-5.459816427 },
{ "GRIDCODE": 1784, "lat": 35.89844499, "long":-5.476482759 }
]
};
呼如林
相关分类