const artistInput = document.querySelector('.input__text_artist');
const songInput = document.querySelector('.input__text_song'); .... form.addEventListener('input', function (event) { if (artist.value.length === 0 || song.value.length === 0) { console.log('Кнопка выключена'); } else { console.log('Кнопка включена'); } }); artist и artistInput это разные вещи? |
voraa,
да |
А где определение и задание artist?
Чего в консоле то пишет? |
|
Ну я же спрашиваю, Вы в консоль то смотрите?
Я добавил туда этот код if (artist.value.length === 0 || song.value.length === 0) { console.log('Кнопка выключена'); } else { console.log('Кнопка включена'); } Получаю: ReferenceError: artist is not defined На строкуif (artist.value.length === 0 || song.value.length === 0) { А вы пишете, что та же самая ошибка Uncaught SyntaxError: Unexpected token '{' Где определение и задание переменной artist? |
Часовой пояс GMT +3, время: 00:46. |