如何在这里传递这个变量值?下面的代码不起作用。而关于 Stackoverflow 的所有其他讨论都不清楚。
<script type="text/javascript">
function check()
{
var dist = document.getElementById('value');
if (dist!=""){
window.location.href="district.php?dist="+dist;
}
else
alert('Oops.!!');
}
</script>
我的 HTML 代码是:
<select id="value" name="dist" onchange="return check()">