From f5f211ca5eed2db42f4a0e8893eb1b900a5b768e Mon Sep 17 00:00:00 2001 From: kaBeech Date: Sat, 18 Mar 2023 16:51:05 -0700 Subject: [PATCH] Add ability to input custom example text --- index.html | 7 +++++++ index.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 08e6b47..b640ebc 100644 --- a/index.html +++ b/index.html @@ -30,6 +30,7 @@

THE FIVE TALL BOXING WIZARDS JUMP QUICKLY!

0123456789.:,;(*!?')

+
@@ -45,6 +46,12 @@

+
+ + + +
+

Downloads

diff --git a/index.js b/index.js index 9f9668f..48b5587 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ -const exampleTextClasses = document.getElementById("exampleText").classList; - +const exampleText = document.getElementById("exampleText"); +const exampleTextClasses = exampleText.classList; const seriousButton = document.getElementById("seriousButton"); const seriousItalicButton = document.getElementById("seriousItalicButton"); const seriousBoldButton = document.getElementById("seriousBoldButton"); @@ -10,6 +10,8 @@ const seriousLightButton = document.getElementById("seriousLightButton"); const seriousLightItalicButton = document.getElementById( "seriousLightItalicButton" ); +const newExampleTextButton = document.getElementById("newExampleTextButton"); +const newExampleText = document.getElementById("newExampleText"); seriousButton.addEventListener("click", function () { this.classList.add("selected"); @@ -100,3 +102,7 @@ seriousLightItalicButton.addEventListener("click", function () { exampleTextClasses.remove("seriousLight"); exampleTextClasses.add("seriousLightItalic"); }); + +newExampleTextButton.addEventListener("click", function () { + exampleText.setHTML(newExampleText.value); +});