[英]Passing Variable From Javascript to HTML Form
我正在嘗試制作一個簡單的理想重量計數器,我認為邏輯是正確的,但代碼中一定有問題,有人可以告訴我它在哪里..? 謝謝..
<html> <body> Height (Cm) <input type=text id="height"><br> <button onClick="Count()">Submit</button><br> Ideal Weight (Kg) <input type=text id="ideal"><br> <script> function Count() { var hei = document.getElementById('height').Value; var ideal = (hei - 100)- ((hei - 100)*0.1); document.getelementById('ideal').value = ideal; } </script> </body> </html>
我認為有兩個問題:
var hei = document.getElementById('height').**v**alue;
和
document.get**E**lementById('ideal').value = ideal;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.