Home >Backend Development >PHP Tutorial >onclick跳转有关问题

onclick跳转有关问题

WBOY
WBOYOriginal
2016-06-13 12:25:291001browse

onclick跳转问题


  怎么能onclick之后获取 "t" 的值  在跳到query
------解决思路----------------------
document.getElementById("t").value  得到t  值,然后赋值给query
------解决思路----------------------

<br />function load(){<br />    var id=document.getElementById("t").value;<br />    window.location.href = url=‘city.php?module=query&t='+t;<br />}<br />

------解决思路----------------------
{literal}
<script><br />function load(){<br /><span style="color: #FF0000;">var id=document.getElementById("t").value;<br />alert(url=<span style="color: #FF0000;">‘city.php?module=query&t='+<span style="color: #FF0000;">t; );//这个t变量根本没有定义。你定义的是id...<br />}<br /></script>
{/literal}

{literal}<br /><script language="javascript"><br />function load(){<br />var id=document.getElementById("t").value;<br />alert(url='city.php?module=query&t='+id);<br />location.href=url;<br />}<br /></script><br />{/literal}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn