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

onclick跳转问题

WBOY
Release: 2016-06-23 13:25:26
Original
1082 people have browsed it



  怎么能onclick之后获取 "t" 的值  在跳到query


回复讨论(解决方案)

document.getElementById("t").value  得到t  值,然后赋值给query

document.getElementById("t").value  得到t  值,然后赋值给query


我也是这么想的呢  但是就是行不通
{literal}
<script> <br />function load(){ <br />var id=document.getElementById("t").value; <br />alert(url=‘city.php?module=query&t='+t; ); <br />} <br /></script>
{/literal}
这应该对啊

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

{literal}

{/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}
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template