This was one of the issues I ran into with earlier versions of GWT (Google Web Toolkit). GWT was google's answer to giving JAVA developers a way to write JavaScript code using JAVA.
We started out using a single anonymous inner class to handle
each event/element on a web page. It worked fine when you didn't have very many elements, which wasn't realistic for a web page. So, as the number of elements grew it got to be unmanageable and cluttered. Then we quickly got into the same issue you are raising. Google solved it by using an event bus in later versions of GWT.
How did that solve it? They created a pattern where you abstract the conditions up one level to the event bus and let it call the proper handler.
However, getting back to your javascript question, here is a good, simple explanation for the pattern, Handling events for many elements
Really, in my thinking, what you want to do is avoid the cyclomatic complexity pattern altogether like I said by abstracting up one level with a event bus or eventhandler or map, that ultimately calls a function to avoid code duplication and solve this issue with another pattern.
I would rather create more small functions and hence make the code more component-like than allow the if/else pattern to keep reproducing itself. I've found that there is no end to the pattern once you head down that path and you will keep being forced to add more if/else statements until you refactor the code with a better solution.
I recall seeing this same thing in JAVA code where they were training
COBOL developers to learn JAVA and the ones that kept their procedural mindset constantly fell into this pattern. I once saw a switch statement with 26 conditions checking for a single type condition.
Here are some good tips for Cyclomatic Complexity Refactoring Tips with good code examples.