Home > Article > Backend Development > onclick跳转问题
怎么能onclick之后获取 "t" 的值 在跳到query
document.getElementById("t").value 得到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> <br />function load(){ <br /> var id=document.getElementById("t").value; <br />alert(url= ‘city.php?module=query&t='+ t; );//这个t变量根本没有定义。你定义的是id... <br />} <br /></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}