JavaScript onclick requires two clicks

前端 未结 8 1125
执笔经年
执笔经年 2021-01-14 19:33

My problem is that when onclicktriggers the toggleNew function it\'s not executing but when I click the div a second time it\'s execut

8条回答
  •  甜味超标
    2021-01-14 20:18

    In your condition : Use onclick="toggleNew();" // calling

    This is the way to call a function.

    And if you want to Pass the function then you use only toggleNew //passing

    They are two different activities.

提交回复
热议问题