I have a function to which a give my select option value as the second parameter, then it must execute.
const words = getWords(choosePage(0, 29), second par);
the problem is select is created dynamically and to get to the value a need to write body.addEventListener().
function chooseGroup () {
const gameAudioDesc = document.querySelector('.select-audio-play-difficulty') as HTMLInputElement;
console.log('выбор группы' + ': ' + gameAudioDesc.value)
return gameAudioDesc.value;
}
body.addEventListener('change', chooseGroup);
how to make it work correctly?