function show(ev) { 
    var element = ev.target;
    element.style.backgroundColor = "white"; 
    element.style.color = "black";
  }
function out(ev) {
    var element = ev.target;
    element.style.backgroundColor = "";
    element.style.color = "";
}
  
  function addAll() {
    var item;
    var checks = document.getElementsByTagName("span"); 
    for (item of checks) {
      if (item.getAttribute("class") == "check") {
        item.addEventListener("mousedown", show, false);
        item.addEventListener("mouseup", out, false);
      }
    }
  }
  window.onload = addAll;
  