Zeile 28 | Zeile 28 |
---|
<div><textarea id="code" name="code"> class Greeter {
|
<div><textarea id="code" name="code"> class Greeter {
|
greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; }
| greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; }
|
}
var greeter = new Greeter("world");
| }
var greeter = new Greeter("world");
|
Zeile 42 | Zeile 42 |
---|
var button = document.createElement('button') button.innerText = "Say Hello" button.onclick = function() {
|
var button = document.createElement('button') button.innerText = "Say Hello" button.onclick = function() {
|
alert(greeter.greet())
| alert(greeter.greet())
|
}
document.body.appendChild(button)
| }
document.body.appendChild(button)
|