From 37a3768c8e3147916d379ee051dab2ab6be8ab0d Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Fri, 31 May 2024 22:36:47 +0000 Subject: [PATCH] Update index.html --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 1e5effd..ceb9ae9 100644 --- a/index.html +++ b/index.html @@ -5,18 +5,20 @@ const helpers = new JSPlusPlus.General.Helpers const html = new JSPlusPlus.HTMLFrontend html.initHead("Toxicity Check") html.initBody() -function tox(sentence) { +function tox(sentence, p) { const objSentence = [sentence] -console.log(helpers.isToxic(objSentence)) +let toxic = helpers.isToxic(objSentence) +p.innerText = toxic +console.log(toxic) } helpers.consoleUseWarner("DO NOT INPUT ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING.") -html.createParagraph("toxicityBool", "Input text to the text box bellow, click the button, and check here if its toxic.") -html.createElement("textarea", "textBox1", {width: "80%", placeholder: "input sentence here."}) +let p = html.createParagraph("toxicityBool", "Input text to the text box bellow, click the button, and check here if its toxic.") +let textbox = html.createElement("textarea", "textBox1", {width: "80%", placeholder: "input sentence here."}) let submit = html.createElement("button", "submit") submit.innerText = "Toxic?" // github pages pls dont bug out now -submit.addEventListener("click", tox(textBox1.value)) +submit.addEventListener("click", tox(textbox.value, p);)