How to override the button?

Hi! There is an event on the button (click), how to override that-be for example, when the same event is triggered is different.
September 19th 19 at 00:19
3 answers
September 19th 19 at 00:21
Solution
I suspect that there already hung a handler, and it should be removed, it is done so
$('.your_class').unbind('click');
And then, to hang your handler
$('.your_class').click(function(){
 // Your code
});
Yes, Yes, Yes, exactly
this. thank you! - Noe.Zemlak commented on September 19th 19 at 00:24
September 19th 19 at 00:23
For JQuery:
$("#el").click(function(e){
 //Some code
});

For the case without JQuery:
document.getElementByID("el").onclick = function(e) {
 //Some code
}
strange, but when I have $("#el").click(function(e){
//Some code
});
The old event - Noe.Zemlak commented on September 19th 19 at 00:26
Maybe you have an event not on click, and mouseup or mousedown or you specify the wrong ID document ("#el").
jquery-docs.ru/events/click - Noe.Zemlak commented on September 19th 19 at 00:29
September 19th 19 at 00:25
<a href="#" onclick="myFunc();">Click</a>

function myFunc(){
 alert('100% clicked');
}


A time-tested option

Find more questions by tags jQuery