From 813788bcc1ae2831fdfd47b45f2d3198de7daf71 Mon Sep 17 00:00:00 2001 From: Dangrainage <99558179+Dangrainage@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:41:31 +0200 Subject: [PATCH] Update Tester.HTML --- Tester.HTML | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Tester.HTML b/Tester.HTML index 6e0b3cb..8238dd7 100644 --- a/Tester.HTML +++ b/Tester.HTML @@ -38,22 +38,14 @@ if (results.length === 0) { searchResultsDiv.textContent = 'No results found.'; } else { - let resultList = document.createElement('ul'); results.forEach(result => { - let listItem = document.createElement('li'); let link = document.createElement('a'); link.textContent = `${result.title} (${result.year})`; - link.href = result.link ? result.link : '#'; // If link is not available, set href to '#' - link.onclick = function() { - if (result.link) { - window.location.href = result.link; - } - }; - console.log("Link:", result.link); // Log link to console for debugging - listItem.appendChild(link); - resultList.appendChild(listItem); + link.href = result.link; + link.style.display = 'block'; + link.style.marginBottom = '10px'; + searchResultsDiv.appendChild(link); }); - searchResultsDiv.appendChild(resultList); } }