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