Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Jquery learn
why can't I take the value from the input field https://code.sololearn.com/W7cCuXg63Qf6/?ref=app
2 Respostas
+ 4
Because it retrieves the value right after the document is loaded.
You need to included it inside the click event.
0
varĀ is scoped to the nearest function block andĀ letĀ is scoped to the nearestĀ enclosingĀ block.
As if you want to use let, then as Toni Isotalo mentioned use it inside click event