Skip to content

Instantly share code, notes, and snippets.

@RichoDemus
Created February 15, 2016 16:58
Show Gist options
  • Save RichoDemus/982cbbdb13e5917c301c to your computer and use it in GitHub Desktop.
Save RichoDemus/982cbbdb13e5917c301c to your computer and use it in GitHub Desktop.
javascript weirdness
"use strict";
class Input
{
constructor(startButton)
{
this.startButton = startButton;
startButton.onclick = this.start;
}
start()
{
//this button references is unset, I guess class "instances" works differently in js :/
this.startButton.disabled = true;
//this is what I have to do
document.getElementById("startButton").disabled = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment