<html>
<head>
<title>J7_1 </title>
</head>
<body>
<h1 align="center">人民币和各种外汇比价折算 </h1>
<h3 align="center">请选择一种外汇,并完成计算: </h3>
<p align="center">
一 <select onChange="document.getElementById('forRMB1').value=this.value;document.getElementById('exchange2').innerHTML=this.options[this.selectedIndex].text" id="exchange1">
<option selected="selected">--请选择-- </option>
<option value="6.82">美元 </option>
<option value="0.07">日元 </option>
<option value="5.58">加拿大元 </option>
<option value="9.58">欧元 </option>
<option value="4.66">澳大利亚元 </option>
<option value="10.03">英镑 </option>
<option value="0.88">港币 </option>
<option value="0.85">澳门元 </option>
<option value="6.33">瑞士法郎 </option>
</select>
可以兑换:
<input width="100" type="text" id="forRMB1" />元人民币
</p>
<p align="center">
<input width="100" id="amount" onBlur="document.getElementById('forRMB2').value=this.value*document.getElementById('exchange1').value"/>
<span id="exchange2"></span><!-- 表达这个意思? -->
<!-- //为什么得不到exchange1的值呢,就是那个外币种类,一直得到汇率,不解?????????
<input width="100" id="exchange2" onClick="this.value=document.getElementById('exchange1').value" /> -->
可以兑换:
<input width="100" type="text" id="forRMB2"/>元人民币
</p>
</body>
</html> 你要表达这个意思?
用text的话 把
document.getElementById('exchange2').innerHTML
换成
document.getElementById('exchange2').value
就可以了