JS页面赋值

时间:2024-10-12 14:07:07

<html>

 <title>页面1</title>

<div>

<ul>

 <li>
<div class="electronic">订单号:</div><input type="text" class="inputs" id="Order" />
</li>
<li style="float:right;">
<div class="electronic">C-ASIN:</div><input type="text" class="inputs" id="ASIN" />
</li>

<li style="float: right; padding-left:300px;">
<a href="#" class="notification-icon custom_fa-searchBy3j_001" id="ShowMailQuery">
<img src="~/Content/img/query.png" style="vertical-align: middle; width: 22px; margin-top:-3px;" />
</a>
</li>

</ul>

</div>

</html>

//页面二

<div>

<ul>

 <li>
<div class="electronic">订单号:</div><input type="text" class="inputs" id="Orders" />
</li>
<li style="float:right;">
<div class="electronic">C-ASIN:</div><input type="text" class="inputs" id="ASINs" />
</li>

</ul>

</div>

<script type="text/javascript">

//js赋值
$(document).ready(function () {

//点击跳转的事件
$('#ShowMailQuery').click(function () {
document.getElementById("ASINs").value = document.getElementById("ASIN").value;
document.getElementById("Orders").value = document.getElementById("Order").value;
})
})

//跳转页面事件就不写了

</script>