From f12b4e161885d6806381ba60349b55a5645b3d96 Mon Sep 17 00:00:00 2001 From: YanivZalach Date: Thu, 25 Jan 2024 13:38:42 +0200 Subject: [PATCH] Make safer with innerText --- js/output.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/output.js b/js/output.js index e21169a..f631004 100644 --- a/js/output.js +++ b/js/output.js @@ -23,7 +23,7 @@ export async function outCsvFile(file,resultElement){ cell = document.createElement('td'); // List element } // Adding the data - cell.innerHTML = file[row][column]; + cell.innerText = file[row][column]; print(file[row][column]) // Appending to the list table_row.appendChild(cell); @@ -51,7 +51,7 @@ export function addNameH2(name,resultElement){ print(name); const h2 = document.createElement('h2'); // Creating h2 element h2.id = name; // Adding an id - h2.innerHTML = name; // Adding the name to the element + h2.innerText = name; // Adding the name to the element resultElement.appendChild(h2); // Adding the element to the dom } else { // Didn't got a name print("Name not given");