* * I have an object that is unclickable in the previous stage of the page, and something else happens when I click on it in the next stage.
I wrote two onclick methods on this object that run when the page onload. The second one overrides the first method1 method with the method2 method, which is expected to happen.
now I need to run the first method1. It makes sense for me to remove the second method and run it. The question is: what method should I use to remove the method2 method? * *
window.onload=function(){
method1();
method2();
}
function method1(){
var object=document.getElementById(object); //method2
object.onclick=function(){
console.log("OK");
}
}
function method2(){
var object=document.getElementById(object);
object.onclick=function(){
alert("disable");
}
}