Не работает javascript?

0

 Тема урока : HTML формы: input, textarea, checkbox, radio, slider и другие

не сработал скрипт

 <script>
 const volume = document.querySelector('#volume');
 const output = document.querySelector('.volume-output');
output.textContent=volume.value  

volume.addEventListener('input',() => {
    output.textContent=volume.value
}
    </script>
javascript

3 ответов

0

По подсветке кода даже видно, что что-то не так (<input name bla bla bla)

1. Скрипт js нужно вставлять в самом низу страницы перед </body>, как в уроке.

2. Вот тут живой интерактивный код можно посмотреть как должно быть и сравнить со своим кодом можно:

https://fructcode.com/ru/courses/html-and-css-advanced/interactive-basic-html-tags-form-slider/

0

Добрый вечер HTML and JavaScript

<h2>Slider Form</h2>
<form action="">
    <input name="volume" type="range" id="volume "min="0.1" max="100000" step="1" value="99999">
    <output class="const-output"></output>
    <script>
                const volume = document.querySelector('#volume');
        const output = document.querySelector('.volume-output');
output.textContent=volume.value  

volume.addEventListener('input',() => {
    output.textContent=volume.value
}
    </script>
</form>

 

0

В html что написано?

Sign up or Log in to write an answer