<label for="volume">볼륨</label>
<input type="range" id="volume" min="0" max="100">

<!-- 사용자가 조작한 슬라이더 값이 실시간으로 표시될 위치 -->
<output for="volume" id="volume-output" style="color: red;"></output>
실제 적용된 모습 슬라이더를 움직이면 바로 옆에 현재 값이 빨간색으로 표시됩니다.
const value = document.querySelector("#volume-output");
const input = document.querySelector("#volume");
value.textContent = input.value;
input.addEventListener("input", (event) => {
  value.textContent = event.target.value;
});
<label for="volume">볼륨</label>
<input type="range" id="volume" min="0" max="100">
<output for="volume" id="volume-output"></output>
<label for="num1">숫자 1:</label>
<input type="number" id="num1" value="10">
<br>

<label for="num2">숫자 2:</label>
<input type="number" id="num2" value="20">
<br>

<!-- 계산 결과를 출력할 부분 -->
<label for="result">계산 결과:</label>
<output for="num1 num2" id="result"></output>
<form id="volume-form">
    <label for="volume">볼륨</label>
    <input type="range" id="volume" min="0" max="100" step="10">
    <output for="volume" id="volume-output" form="volume-form"></output>
</form>
<form>
    <label for="price">가격</label>
    <input type="number" id="price" value="1000">
    <br>
    <label for="discount">할인율</label>
    <input type="number" id="discount" min="0" max="100" value="10">
    <br>
    <label for="total">총 가격</label>
    <output id="total-price" name="total" for="price discount"></output>
</form>
const form = document.querySelector("form");
const priceInput = form.elements["price"];
const discountInput = form.elements["discount"];

/* form.elements API를 사용하여 <output> 태그를 참조 */
const totalOutput = form.elements["total"];

function calculateTotal() {
const price = parseFloat(priceInput.value);
const discount = parseFloat(discountInput.value);
const total = price - (price * discount / 100);
totalOutput.textContent = total.toFixed(2);
}

calculateTotal();
priceInput.addEventListener("input", calculateTotal);
discountInput.addEventListener("input", calculateTotal);
실제 적용된 모습