藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年8月25日 8:28

簡單數字向加問題請教,在線等

<script language="javascript">
function setid()
{
  i=window.form1.upcount.value;
  window.form1.upcount.value=i+1;
}
</script>
<input type="text" name="upcount" style="width:50;" value=1>
我得原意是想得到upcount累加1,2,3,4....
但是通過上面得代碼發現變成了 11
怎麼修改一下那,多謝了,在線等

window.form1.upcount.value=i*1+1;

知道原因了
需要作個轉換
parseInt(string)




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com