0

Concept of unbind in js

I am using some library . it has some pre define click events. I want to off them so I used unbind method. luckily, it worked . I need my own click event on some of that elements but when I write my click event function , library click event also get activated. I can't go through library events list , its complicated

16th Aug 2020, 7:59 PM
anjit pariyar
anjit pariyar - avatar
2 Answers
+ 2
You can look for the event.preventDefault() method if that helps
16th Aug 2020, 9:31 PM
Abhay
Abhay - avatar
0
Abhay , did you mean event.stopPropagation()? Well, I use elem.off('click').on('click', function(){}) as I am using jquery . but what's the use of unbind property
17th Aug 2020, 3:35 AM
anjit pariyar
anjit pariyar - avatar