Need to launch function after click event. Help, please. Why it launchs auto without click on calculator Id
function check(){ let youname = document.getElementById("youname").innerHTML alert(youname) } document.getElementById("calculator").onclick = check()
You are running the check function. The parentheses () will invoke the function.
check
()
The handler just takes the function identifier (name) as the callback, the handler will run the callback function for you when the event it is listening for fires.
document.getElementById("calculator").onclick = check;