I would like to do something like this
$("#A").on("click", function(){
$.event.trigger({type:"custom"});
});
$("#B").on("custom", function(e){
$("#B").removeClass("hidden");
});
$("#C").on("custom", function(e){
alert("something");
}
Where I trigger a custom event using JavaScript. I would then like to be able to use the .on
function on different elements throughout the page. Clicking the "#A" would then trigger the event for all registered elements.
I noticed that the trigger function is called on an element instead of globally, which is not what I want.