比如说,以前是这样的 <a href="buy.jsp">购买</a>
现在我想通过一个按钮来实现这个功能,比如说<input bype="button" name="buy" value="购买">,想通过这个按钮跳到buy.jsp页面,该怎么办呢?谢谢
现在我想通过一个按钮来实现这个功能,比如说<input bype="button" name="buy" value="购买">,想通过这个按钮跳到buy.jsp页面,该怎么办呢?谢谢
<input bype="button" name="buy" onclick="toBuy();" value="购买">javascript 可以这样写:
function toBuy(){
window.location.href = 'buy.jsp';
return;
}
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
function goto(){
window.location.href="login.jsp?...参数";
}
</script>
<body>
<input type='button' value='gotoJsp' onclick='goto();'/>
</body>
</html>