Does using event.preventDefault() in “mousedown” prevent “click” or “mouseup” event in jquery?

前端 未结 2 1594
半阙折子戏
半阙折子戏 2021-01-04 04:34

I am new to jquery and i have a doubt whether using events.preventDefault() in the mousedown or mouseup events does preve

2条回答
  •  爱一瞬间的悲伤
    2021-01-04 05:03

    It does not prevent the event itself, but the action that is triggered by the event.

    A simple example would be clicking on an anchor link. The default action of the click event is to take the browser to a new URL. In this case, it won't happen.

提交回复
热议问题