日期:2014-05-16 浏览次数:20665 次
<input type="hidden" id="hidden1" name="yhbh" value="123">
<a onclick="goto()">goto</a>
function goto(){
alert($("#hidden1").val())
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<title>test</title>
<script type="text/javascript" src="js/app.js"></script>
</head>
<style type="text/css">
</style>
<body>
<input type="text" value="test" class="txt" />
<a href="http://www.test.com" title="" class="link">click</a>
<script type="text/javascript">
$(function(){
var val = $(".txt").val(),href = $(".link").attr("href");
$(".link").attr("href",href +"?aa="+ val);
})
</script>
</body>
</html>