<input type="text" id="t" value="" name="t"/>
<input type="button" class="anniu4" value="查询" onclick="window.location='city.php?module=query'"/>
怎么能onclick之后获取 "t" 的值 在跳到query
------解决思路----------------------
document.getElementById("t").value 得到t 值,然后赋值给query
------解决思路----------------------
function load(){
var id=document.getElementById("t").value;
window.location.href = url=‘city.php?module=query&t='+t;
}
------解决思路----------------------
{literal}
<script language="javascript">
function load(){
var id=document.getElementById("t").value;
alert(url=‘city.php?module=query&t='+t; );//这个t变量根本没有定义。你定义的是id...
}
</script>
{/literal}
{literal}
<script language="javascript">
function load(){
var id=document.getElementById("t").value;
alert(url='city.php?module=query&t='+id);
location.href=url;
}
</script>
{/literal}