click on link should not trigger parental onclick-event

前端 未结 4 1606
长发绾君心
长发绾君心 2021-01-13 17:38

I\'ve got the following code:


      
4条回答
  •  误落风尘
    2021-01-13 18:01

    $(function (){
      $('#link').click(function (e){ e.stopPropagation(); /*do other thing*/});
    })
    

提交回复
热议问题