From: Carl Worth Date: Wed, 7 Dec 2022 09:31:43 +0000 (-0800) Subject: Fix DOM code so that prompt and code appear for each image X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=53806afc9bf4bc0cfdd069a6de63db820b004d4a;p=zombocom-ai Fix DOM code so that prompt and code appear for each image The DOM really does make things so painful! --- diff --git a/index.html b/index.html index 83afa86..fb8cbc0 100644 --- a/index.html +++ b/index.html @@ -135,9 +135,11 @@ mute.addEventListener("click", () => { const img = document.createElement('img'); img.src = image.filename; const p_prompt = document.createElement('p'); - p_prompt.innerHtml = `Prompt: ${image.prompt}`; + const prompt_text = document.createTextNode(`Prompt: ${image.prompt}`); + p_prompt.appendChild(prompt_text); const p_code = document.createElement('p'); - p_code.innerHtml = `Code: ${image.code}`; + const code_text = document.createTextNode(`Code: ${image.code}`); + p_code.appendChild(code_text); images.appendChild(img); images.appendChild(p_prompt); images.appendChild(p_code);