const targetName = document.querySelectorAll('.name'); for(let i = 0; i < targetName.length; i++) { targetName[i].onClick = function() { for(let j = 0; j < arr.length; j++) { if(targetName[i].textContent === arr[j].firstName + ' ' + arr[j].lastName) { return printRole(arr[j]); } } } } //제대로 작동하지 않음 const targetName = document.querySelectorAll('.name'); targetName.forEach(function(el) { el.addEve..