addEventListener in Javascript triggers the click event automatically

前端 未结 1 375
天涯浪人
天涯浪人 2020-12-11 13:25

I want to make a simple javascript countdown program. For some reason the countdown triggers without me having to click the start link.

         


        
相关标签:
1条回答
  • 2020-12-11 14:11

    That's because startCountDown() calls the function startCountDown. Remove the parentheses, and it'll work.

    0 讨论(0)
提交回复
热议问题