<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>html取值和赋值</title>
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
<style type="text/css">
.d1,.d2{
width: 100%;
height: 300px;
background: #ccc;
}
</style>
</head>
<body>
<p>
<input type="text" name="" id="" value="" />
</p>
<p>
<button class="btn">>></button>
</p>
<input type="text" name="" id="" value="" />
<p>
</p>
</body>
<script type="text/javascript">
$(".btn").click(function(){
val=$("input").eq(0).val();
$("input").val(val);
});
</script>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>html取值和赋值</title>
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
<style type="text/css">
.d1,.d2{
width: 100%;
height: 300px;
background: #ccc;
}
</style>
</head>
<body>
<p>
<input type="text" name="" id="" value="" />
</p>
<p>
<button class="btn">>></button>
</p>
<input type="text" name="" id="" value="" />
<p>
</p>
</body>
<script type="text/javascript">
$(".btn").click(function(){
val=$("input").eq(0).val();
$("input").val(val);
});
</script>
</html>