Javascript examples for DOM HTML Element:Output
Output value Property - Get the result of a calculation:
<!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>/*from ww w . j a v a2s . co m*/ <button type="button" onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myOutput").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>