'use strict' window.onload = function () { var b = document.getElementById('my-button') b.onclick = function () { window.alert('foo') } }