I have the following code:
function myFunction(){
var bob = function() {
alert("works");
}
};
//document.getElementById("btn").addEventListener('click', bob); //calls the function
}
How do I call the bob function outside the myFunction() ? It works with the btn element, but I want it to be called outside
Thanks !