HTML5: How to specify a name for the output element?
Solution:
HTML Code:
Explanation:
- The HTML code demonstrates how to specify a name for the output element that displays the sum of two input values.
- It includes a form with two input elements: a range slider (<input type="range">) and a number input (<input type="number">).
- The sum of the values from these inputs is calculated using JavaScript (oninput event) and displayed in an output element (<output>).
- However, there's a syntax error with a nested <form> tag without attributes, which seems to be a typo and should be removed for proper HTML structure.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.