function searchUser(search) { matches = []; users.forEach(user => { if (user.id.toLowerCase().includes(search.toLowerCase())) { matches.push(user); } }); if (matches.length === 0) { document.getElementById("users-parent").innerHTML = "

No matches found

"; } else { var html = ""; matches.forEach(match => { html += `

${ match.id }

${ match.achievements.length } achievement${(match.achievements.length != 1) ? "s" : "" }
` }); document.getElementById("users-parent").innerHTML = html; } }