Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <p>Click the button to create an OUTPUT element.</p> <form id="myForm" 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">= </form> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.createElement("OUTPUT"); x.setAttribute("name", "x"); x.setAttribute("for", "a b"); document.getElementById("myForm").appendChild(x); document.getElementById("demo").innerHTML = "The output element was created. Change the value of the range or number field to see the result of a calculation."; } </script> </body> </html>