function show(ev) { 
  var element = ev.target;
  element.style.backgroundColor = "green";
}
function addAll() {
  var item;
  var checks = document.getElementsByTagName("span"); 
  for (item of checks) {
    if (item.getAttribute("class") == "check") {
      item.addEventListener("click", show, false);	
    }
  }
}
