Update Tester.HTML

This commit is contained in:
Dangrainage 2024-04-24 23:45:49 +02:00 committed by GitHub
parent ac7dabac06
commit 85df6dcfe1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,11 @@
let resultList = document.createElement('ul');
results.forEach(result => {
let listItem = document.createElement('li');
listItem.textContent = `Title: ${result.title}, Year: ${result.year}`;
let link = document.createElement('a');
link.textContent = `${result.title} (${result.year})`;
link.href = result.link; // Assuming there's a 'link' property in the dictionary
link.target = '_blank'; // Open link in a new tab
listItem.appendChild(link);
resultList.appendChild(listItem);
});
searchResultsDiv.appendChild(resultList);