Guest User

Untitled

a guest
Jul 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class MainClass {
  2. constructor() {
  3. this.playButton = new ShowButton(this.display);
  4. this.name = "some stuff";
  5. }
  6.  
  7. display() {
  8. console.log("calling display()");
  9. console.log(this.name);
  10. }
  11. }
  12.  
  13. class ShowButton {
  14. constructor(aPlayFunction) {
  15. this.x = 100;
  16. this.y = 100;
  17. this.button = document.createElement('playButton');
  18. this.button.innerHTML = 'play';
  19. this.button.onclick = aPlayFunction;
  20. document.body.appendChild(this.button);
  21. }
  22. }
  23. let main = new MainClass();
Add Comment
Please, Sign In to add comment