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> <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 value of the for attribute of the output element.</p> <p><strong>Note:</strong> 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").htmlFor; document.getElementById("demo").innerHTML = x; } </script> </body> </html>