From 2b89b98955abf3ba3c49f3d426127a0c8f866737 Mon Sep 17 00:00:00 2001 From: Mark Crowther Date: Tue, 30 Jun 2020 16:43:01 +0100 Subject: [PATCH] Added onClick Name Changer --- README.md | 1 + nameChange/index.html | 16 ++++++++++++++++ nameChange/namechange.js | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 nameChange/index.html create mode 100644 nameChange/namechange.js diff --git a/README.md b/README.md index 44f00df..a9af007 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ If there's anything that you think could be improved due to misunderstanding, th # The 1000 Things Structure of the repo Things are as *folder > main js file*, along with the supporting HTML and CSS files. +(6) Name Changer > namechange.js
(5) Message Changer > messageChanger.js
(4) Time of Day > timeOfDay.js
(3) VAT Calculator > vat-script.js
diff --git a/nameChange/index.html b/nameChange/index.html new file mode 100644 index 0000000..1b0e0eb --- /dev/null +++ b/nameChange/index.html @@ -0,0 +1,16 @@ + + + + Name Changer + + + +

Click the bold text below.

+ +

Once upon a time, a brave adventurer sought fame and fortune.

+

Little did the adventurer know that others sought the same and soon their paths would cross.

+ + + + + \ No newline at end of file diff --git a/nameChange/namechange.js b/nameChange/namechange.js new file mode 100644 index 0000000..d4c1ec2 --- /dev/null +++ b/nameChange/namechange.js @@ -0,0 +1,9 @@ +let yourname = prompt("Enter your name"); + +const names = document.querySelectorAll(".para"); + +for(let i=0; i