how to disable or enable all onClick for images on a page

前端 未结 5 1487
不知归路
不知归路 2021-01-17 17:40

When the user clicks on an image, I want the onClicks on all other images to be disabled until my function has finished.

I currently have this code that disables the

5条回答
  •  情话喂你
    2021-01-17 18:24

    by setting eles[i].onclick = false; you are reassigning the onclick event to false. setting back to true does not assign it back to the original function. It is probably better to handle the un-assigning in the event function instead.

提交回复
热议问题