mirror of
https://github.com/the-spellman/js-plus-plus-toxicity-demo
synced 2024-12-23 09:32:33 -06:00
Update index.html
This commit is contained in:
parent
c928410275
commit
37a3768c8e
1 changed files with 7 additions and 5 deletions
12
index.html
12
index.html
|
@ -5,18 +5,20 @@ const helpers = new JSPlusPlus.General.Helpers
|
||||||
const html = new JSPlusPlus.HTMLFrontend
|
const html = new JSPlusPlus.HTMLFrontend
|
||||||
html.initHead("Toxicity Check")
|
html.initHead("Toxicity Check")
|
||||||
html.initBody()
|
html.initBody()
|
||||||
function tox(sentence) {
|
function tox(sentence, p) {
|
||||||
const objSentence = [sentence]
|
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.")
|
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.")
|
let p = 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 textbox = html.createElement("textarea", "textBox1", {width: "80%", placeholder: "input sentence here."})
|
||||||
let submit = html.createElement("button", "submit")
|
let submit = html.createElement("button", "submit")
|
||||||
|
|
||||||
submit.innerText = "Toxic?" // github pages pls dont bug out now
|
submit.innerText = "Toxic?" // github pages pls dont bug out now
|
||||||
|
|
||||||
submit.addEventListener("click", tox(textBox1.value))
|
submit.addEventListener("click", tox(textbox.value, p);)
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue