Cancel click event in the mouseup event handler

前端 未结 14 2468
梦毁少年i
梦毁少年i 2020-12-09 14:53

Writing some drag&drop code, I\'d like to cancel the click events in my mouseup handler. I figured preventing default should do the trick, but the click event is still f

14条回答
  •  难免孤独
    2020-12-09 15:32

    If you wish suppress the click event you have add the statement event.preventDefault() in the click event handler only and not the mouseup event handler. Use the below code you will get it working.

    test
提交回复
热议问题