<button>Click me!</button>
body {
	padding:2em;
	font-size:2em;
}
View Compiled
class MyClass {
	
	constructor() {

		// Get a reference to the button node
		const btn = document.querySelector('button');

		// Handle by this
		btn.addEventListener('click', this);

		this.nom = 'Pizza 🍕';
		
	}
	
	handleEvent(event) {
		// Should alert 'Pizza 🍕'
		alert(this.nom);
	}
	
}

new MyClass();

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.