+ 3
Why do these functions execute automatically?
Hey everyone, I just got done making a short little program, and it works great, but I was wondering why the button functions execute when the page loads. I know the type function does because I wanted it to be that way, but shouldn't the button functions execute only when you press the button? If I did something wrong, please let me know, thanks in advance https://code.sololearn.com/Wj08FS8TYDSe/?ref=app
3 odpowiedzi
+ 9
They execute when the page loads because you call them immediatly: at the end of your code you wrote:
show();
enter();
which means these functions will be executed
If you want them to work only when a button is clicked, then just remove these two lines I just mentionned
+ 9
You're welcome :)
+ 3
Oh, thank you!