运行 ❯
建立您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <title>Grams to Kilograms Weight Converter</title> <body> <h2>Weight Converter</h2> <p>Type a value in the Grams field to convert the value to Kilograms:</p> <p> <label>Grams</label> <input id="inputGrams" type="number" placeholder="Grams" oninput="weightConverter(this.value)" onchange="weightConverter(this.value)"> </p> <p>Kilograms: <span id="outputKilograms"></span></p> <script> function weightConverter(valNum) { document.getElementById("outputKilograms").innerHTML=valNum/1000; } </script> </body> </html>