+ 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 Answer
+ 3
const inp = document.getElementById("my-in"); btn = () => { console.log(inp.value); }
2nd Oct 2022, 5:06 PM
SoloProg
SoloProg - avatar