Firstly, on the if condition, change lng and lat to theLng and theLat because they are undefined.
(首先,在if条件下,将lng和lat更改为theLng和theLat,因为它们未定义。)
Then, to get the value you have to use .value
, like so :(然后,要获取值,您必须使用.value
,如下所示:)
const theLat = document.getElementById('lat').value;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…