运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output id="myOutput" name="x" for="a b"></output> </form> <p>Click the button to display the result of the calculation.</p> <p><strong>Note:</strong> For this example to work, the result must be shown in the output element. The output element is not supported in Internet Explorer.</p> <button type="button" onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myOutput").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>