I'm very new to programming.
For a school project, I'm trying to set a setTimeout(); function using input from the user. Here is my code:
let header = document.getElementById('header');
let input = document.getElementById('input');
let btn = document.getElementsByTagName('div')[1];
let response1 = document.getElementById('response1');
function playSound() {
setTimeout(function () {
var x = document.getElementById("myAudio")
x.play()
}, 3000); //input.value?? or 1000 * input.value??
}
Normally, if i want to access the user's input within the input box I would type input.value. However, the setTimeout function does not recognize input.value as a parameter that can be set to be used as a countdown. I don't know what to do.
Any help would be greatly appreciated.