简体   繁体   中英

Passing Variable From Javascript to HTML Form

Im trying to make a simple ideal weight counter, i thought the logic is correct but there must be a fault in the codes, can someone show me where is it..? Thank you..

 <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>

I think there are two issues:

var hei = document.getElementById('height').**v**alue;

and

document.get**E**lementById('ideal').value = ideal;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM