js event listener only triggers after other event listener has been triggered code example
Example 1: js addeventlistener
var element=document.getElementById("some_id");
var listener=element.addEventListener('click',function(event){
});
Example 2: event listener works without being clicked
document.getElementById("main_btn").addEventListener("click", function (){
hideId("main");
});
//dont call the function directly, use function that calls it