+ 1

Web playground querySelector and getElement is not working

my code look like: INPUT ------------------------------ tag input, id = "my-in". const in = document getElementById "my-in" console log in OUTPUT ------------------------------ {} why?

2nd Oct 2022, 4:21 PM
João Victor
João Victor - avatar
1 Odpowiedź
+ 3
const inp = document.getElementById("my-in"); btn = () => { console.log(inp.value); }
2nd Oct 2022, 5:06 PM
SoloProg
SoloProg - avatar