Why does the separation of the html and javascript matter to you? I can see the CSS being separate, at the very least for style reuse, but why keep the functionality of a widget off in a separate file, tied only to a widget by class or id? I don't make a conceptual distinction between the button's markup and what the button does, and I want to be able to look at a button in a file and understand what the hell clicking on it makes happen. Moving the code away from the definition of the button is obfuscation, except to designers who can't stand to see a bit of javascript in their HTML.