运行 ❯
获取您的
自有
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 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>