Get your own website Result Size: 625 x 565
x
 
<!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>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_output_create by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:36:20 GMT -->
</html>