How to disable the onload event while the page is running and invalidate an event.

* * 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");
  }
}
Mar.18,2021

objecthandler
addEventLinstener;

,
1method2,1click

1method1;
2method2
  • How can this effect be achieved?

    I would like to ask how to achieve this effect, QQ chat why sometimes send a link is the first form, sometimes a link is the second form? : : http: tieba.baidu.com p 3746... qq there is a corresponding relationship between the above two parts....

    Mar.14,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a4b4-2c1f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a4b4-2c1f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?