0
Jquery learn
why can't I take the value from the input field https://code.sololearn.com/W7cCuXg63Qf6/?ref=app
2 Answers
+ 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