I have some HTML like this:
I already have some events on the parent Anchor object. Now I am trying to add a click event on to the child span element and at the same time to disable click events on the parent Anchor object. I am using jQuery to achieve this, but I could not figure out. My jQuery code is like this:
// some function
If I execute the code above, it prevents the child element click event as well. But if I do not the first part, the parent click event will be triggered as well. Is there a way to disable the parent event without disabling the newly added child click event?
以上就是How to disable click events on a parent DOM object without disabling click events on its child DOM object?的详细内容，更多请关注web前端其它相关文章！