function someClickHandler() {
  alert("せいかいだよ!");
}
window.addEventListener("load", function() {
  var e = document.getElementById("foo");
  e.addEventListener("click", someClickHandler, false);
}, false);
