Skip to content

Instantly share code, notes, and snippets.

@tanabe
Created October 12, 2011 02:16
Show Gist options
  • Select an option

  • Save tanabe/1280047 to your computer and use it in GitHub Desktop.

Select an option

Save tanabe/1280047 to your computer and use it in GitHub Desktop.
var button = new Button(buttonElement);
button.setState = function(state) {
//handle buttonElement
//change style, change size, insert DOM, brah brah brah
};
//the other code accesses DOM tree directly
Element.remove(buttonElement);
button.setState('disable');//error! button cannot access buttonElement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment