Aleksandr Chirkov,
function allButton() {
for (a = 0; a < 7; a++) {
numberOfButton[a] = document.getElementById("button" + a).id;
fullObject[a] = document.getElementById("button" + a);
fullObject[a].onclick = function(f) {
return function() {
oldScore = document.getElementById("sentence" + numberOfButton[f]);
alert(oldScore)
}
}(a)
}
};