JavaScript ближайший атрибут данных
const schoolInfo = [
{ id: '1' }
];
const school = document.querySelector('button');
const popUpInfo = schoolInfo.find(
(x) => x.id == school.closest('[data-idschool]').dataset.idschool
);
console.log(popUpInfo);
EnzoK