Html输入所选城市
<input type="text" id="cityInput" placeholder="请输入城市名" />
<script>
var cityInput = document.getElementById("cityInput");
cityInput.addEventListener("change", function() {
var selectedCity = cityInput.value;
console.log(selectedCity);
});
</script>
原文地址: https://www.cveoy.top/t/topic/ijMu 著作权归作者所有。请勿转载和采集!