2. PROJECT 3:
Build an awesome website
for a Small Business with a
simple JavaScript order
form.
PROJECT 3
Training 1
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 2
www.codejika.com
Desktop – v1
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.
4. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
2019 Copyright Code for Change | Ultimate Growth 4
www.codejika.com
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
4. JS | Send & receive information from HTML.
5. JS | Add input from form and play hide & seek.
6. Footer, TEAM section & content writing.
5. 1. Code the site structure
2. Add a header
3. Formulate an “Intro” section.
TRAINING SNAPSHOT
These are your missions for today.
PROJECT 3 – TRAINING 1
2019 Copyright Code for Change | Ultimate Growth 5
www.codejika.com
PREVIEW
6. Code the site structure.
. . .
MISSION
This mission will include 2 challenges.
2019 Copyright Code for Change | Ultimate Growth 6
www.codejika.com
7. 2019 Copyright Code for Change | Ultimate Growth 7
www.codejika.com
START.
Start by setting
up the skeleton
of your code.
<!DOCTYPE html>
<head>
<style>
</style>
</head>
<body>
</body>
8. Add this section:
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 8
www.codejika.com
<!DOCTYPE html>
<head>
<style>
</style>
</head>
Save a new notepad file
as .html .
TIP:
9. Now add <header> and
<section> in <body>.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 9
www.codejika.com
<body>
<header>
</header>
<section>
</section>
</body>
10. 2019 Copyright Code for Change | Ultimate Growth 10
www.codejika.com
GREAT JOB!
11. 2019 Copyright Code for Change | Ultimate Growth 11
www.codejika.com
Or who are you making it
for?
What’s the name of your
business?
THINK
12. Add a simple header, h1 & sub-title.
. . .
MISSION
This mission will include 5 challenges.
2019 Copyright Code for Change | Ultimate Growth 12
www.codejika.com
13. Add an <h1> in <header>
with your company name or
brand.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 13
www.codejika.com
<h1>
Awesome Industries Inc.
</h1>
14. Under the <h1> place an <h4>
with the company tagline.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 14
www.codejika.com
<h4>
Cute Cupcakes for Best
Besties
</h4>
15. 2019 Copyright Code for Change | Ultimate Growth 15
www.codejika.com
NICE.
Keep it up.
16. 2019 Copyright Code for Change | Ultimate Growth 16
www.codejika.com
Now let’s style the
<body> and
<header>.
17. Add a body selector in CSS
with these styles:
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 17
www.codejika.com
font-family: tahoma;
text-align: center;
TIP:
body { }
18. 2019 Copyright Code for Change | Ultimate Growth 18
www.codejika.com
For your Company name
make it white and have the
letters spaced-out.
19. Add header { } with a
background color and some
padding:
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 19
www.codejika.com
letter-spacing: 6px;
background: royalblue;
padding: 20px;
20. Make the text in header { }
white with a CSS rule.
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 20
www.codejika.com
TIP:
color: ???;
21. CHECKPOINT
Your code should
look like this:
<!DOCTYPE html>
<head>
<style>
body {
font-family: tahoma;
text-align: center;
}
header {
letter-spacing: 6px;
color: white;
background: royalblue;
padding: 20px;
}
</style>
</head>
2019 Copyright Code for Change | Ultimate Growth 21
www.codejika.com
22. 2019 Copyright Code for Change | Ultimate Growth 22
www.codejika.com
MARVELOUS!
Keep it up.
23. Create an “Intro” section with
content about the business.
. . .
MISSION
This mission will include 9 challenges.
2019 Copyright Code for Change | Ultimate Growth 23
www.codejika.com
24. 2019 Copyright Code for Change | Ultimate Growth 24
www.codejika.com
1. Stick a sub-title “Welcome” in
a <h2>.
2. Explain the business in a <p>.
ALRIGHTY THEN.
25. Add an <h2> with this text in it:
WELCOME:
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 25
www.codejika.com
WHERE:
Inside <section>.
26. 2019 Copyright Code for Change | Ultimate Growth 26
www.codejika.com
Tell visitors of the site
about the vision of the business.
NEXT.
27. Write a short Vision Statement.
Here is an example:
CONTENT:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 27
www.codejika.com
VISION: To create beautiful
cupcakes for clients in the
Randburg area.
28. Insert your vision statement in
a <p>.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 28
www.codejika.com
WHERE:
After the welcome </h2> closing tag
and still inside section.
29. 2019 Copyright Code for Change | Ultimate Growth 29
www.codejika.com
Keep it up.
YOU’RE GETTING THERE.
30. Insert 2 <br> tags.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 30
www.codejika.com
WHERE:
After the VISION section. After the
closing tag </p>.
31. 2019 Copyright Code for Change | Ultimate Growth 31
www.codejika.com
Create an “About Us” section.
NOW.
32. Create an “About Us” explaination.
Here is an idea:
CONTENT:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 32
www.codejika.com
ABOUT US: Founded in 2018, by
Thandi Ndlovo.
We've served over 100 clients
and delivered over 10,000 tasty
treats.
33. Add the “About Us” content in
a <p>.
CODE:
CHALLENGE
STEP 6
2019 Copyright Code for Change | Ultimate Growth 33
www.codejika.com
WHERE:
After the VISION and the 2 <br>s.
34. Style h2 with font-size:
2em; and width 100%.
CODE:
CHALLENGE
STEP 7
2019 Copyright Code for Change | Ultimate Growth 34
www.codejika.com
NOTE:
The width: 100%; rule will make sure
that the text does not wrap around other
content.
35. Give the <section>s 30px
padding and margin-bottom:
40px; .
CODE:
CHALLENGE
STEP 8
2019 Copyright Code for Change | Ultimate Growth 35
www.codejika.com
TIP:
section { }
36. 2019 Copyright Code for Change | Ultimate Growth 36
www.codejika.com
You just added 35 lines of code
in the first “Training”.
THAT’S AMAZING!
37. CHECKPOINT
Your code should
look like this:
h2 {
font-size: 2em;
width: 100%;
}
section {
padding: 30px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<header>
<h1>
Awesome Industries Inc.
</h1>
<h4>
Cute Cupcakes for Best Besties
</h4>
</header>
2019 Copyright Code for Change | Ultimate Growth 37
www.codejika.com
...
Content should be
your own.
NOTE:
42. PROJECT 3:
Build an awesome website
for a Small Business with a
simple JavaScript order
form.
PROJECT 3
Training 2
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 42
www.codejika.com
Desktop – v1
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.
44. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
2019 Copyright Code for Change | Ultimate Growth 44
www.codejika.com
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
4. JS | Send & receive information from HTML.
5. JS | Add input from form and play hide & seek.
6. Footer, TEAM section & content writing.
45. 2019 Copyright Code for Change | Ultimate Growth 45
www.codejika.com
DUMELA*.
*”Hello” in Sotho.
46. 1. Learn about CSS Flex.
2. Use CSS Flex to make cool looking
boxes for your content.
TRAINING SNAPSHOT
These are your missions for today:
PROJECT 3 – TRAINING 2
2019 Copyright Code for Change | Ultimate Growth 46
www.codejika.com
47. Learn about CSS Flex
. . .
MISSION
This mission will include 3 challenges.
2019 Copyright Code for Change | Ultimate Growth 47
www.codejika.com
49. BRIEFING Flexbox
Flex allows you to easily space boxes
or images.
1.1.2
Flexbox
2019 Copyright Code for Change | Ultimate Growth 49
www.codejika.com
DESKTOP:
Example: For an image gallery.
50. BRIEFING Flexbox
And they will shrink or stack based
on the screen width.
1.1.2
Flexbox
2019 Copyright Code for Change | Ultimate Growth 50
www.codejika.com
DESKTOP:
MOBILE:
51. BRIEFING Flexbox
To use flex, start with
1. A container.
2. Then add your content.
1.1.2
Flexbox
2019 Copyright Code for Change | Ultimate Growth 51
www.codejika.com
1. 2. 3.
52. BRIEFING Flexbox | Example
1.1.2
Flexbox
2019 Copyright Code for Change | Ultimate Growth 52
www.codejika.com
<section class="container">
<article> </article>
<article> </article>
<article> </article>
</section>
<section>
<article> <article> <article>
STEP 1: Add the container and content.
59. Add a div styled with container
class and 2x <article> tags.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 59
www.codejika.com
Place below “Welcome”
section closing tag
</section>.
WHERE:
<section class="container">
<article> </article>
<article> </article>
</section>
60. Insert a sub-title with <h2> at the
top of the section: SERVICES://
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 60
www.codejika.com
<section class="container">
<h2>
SERVICES://
<h2>
61. 2019 Copyright Code for Change | Ultimate Growth 61
www.codejika.com
SUPER
Now we’re going to add a card
design to the <article> s.
62. Learn & create a “Cards” design
style.
. . .
MISSION
This mission will include 5 challenges.
2019 Copyright Code for Change | Ultimate Growth 62
www.codejika.com
63. BRIEFING DESIGN STYLE: CARDS
1.1.2
2019 Copyright Code for Change | Ultimate Growth 63
www.codejika.com
CARDS
Your flex content will
look like “cards”.
This is a popular
design style.
<article>
CARDS
64. BRIEFING DESIGN STYLE: CARDS
1.1.2
2019 Copyright Code for Change | Ultimate Growth 64
www.codejika.com
CARDS
Each “Card” has
three elements
inside:
1. Icon
(or image)
2. Text
3. Button
65. BRIEFING DESIGN STYLE: CARDS
1.1.2
2019 Copyright Code for Change | Ultimate Growth 65
www.codejika.com
CARDS
Your code will
look like this:
1.
2.
3.
<article class="card">
<div class="icons"> 😎 </div>
<h3>David Mukhura</h3>
<p>Jnr. Web Developer - Creates beautiful
websites for businesses in Soweto.</p>
<button> Contact </button>
</article>
66. 2019 Copyright Code for Change | Ultimate Growth 66
www.codejika.com
ANDIAMO*!
*ITALIAN: “Let’s do this!”
67. Create a CSS class called .card
and link to it in each <article>
tag.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 67
www.codejika.com
<article class="card">
TIP:
.card {
border: 1px solid #ccc;
background-color: ivory;
}
68. Add a padding and margin to the
.card class.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 68
www.codejika.com
.card {
border: 1px solid #ccc;
background-color: ivory;
margin: 25px;
padding: 25px;
}
69. Adapt flex and the “Cards” to
show nicely on larger screens.
Add this CSS:
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 69
www.codejika.com
You can put this at the
end of the CSS code.
TIP:
@media screen and (min-width: 50em) {
.card {
flex-basis: 325px;
}
}
70. Add this to make the site header
look better on small screens:
CODE:
CHALLENGE
NOT RELATED TO “CARDS.”
2019 Copyright Code for Change | Ultimate Growth 70
www.codejika.com
@media screen and (min-width: 50em) {
.card {
flex-basis: 325px;
}
header h1 {
font-size:5em;
}
}
71. 2019 Copyright Code for Change | Ultimate Growth 71
www.codejika.com
FANCY
Let’s add a box-shadow to our
.card .
The next 3 slides are optional.
72. BRIEFING box-shadow: 6px 6px 6px yellow;
1.1.2
box-shadow
2019 Copyright Code for Change | Ultimate Growth 72
www.codejika.com
6px 6px 6px yellow;
1
st
Right
2
nd
Bottom
box-shadow is used by the
experts to make cards &
pictures look more elegant.
Blur means to make
something fuzzy.
TIP:
3
rd
Blur
Effect
4
th
Color
73. BRIEFING RGBA Transparency Trick
1.1.2
RGBA
2019 Copyright Code for Change | Ultimate Growth 73
www.codejika.com
RGBA color: Use the last number
to make it semi-transparent.
Transparent means “See-
through.”
TIP:
rgba ( 0, 0, 0, 0.3)
Red
Green
Blue
Alpha
This doesn’t work in all
browsers.
TIP 2:
74. 2019 Copyright Code for Change | Ultimate Growth 74
www.codejika.com
WHAAAAT !?!?!?!
If you feel like this, don’t worry.
75. Use both box-shadow and a RGBA
color to make your .card super
PRO.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 75
www.codejika.com
.card {
border: 1px solid #ccc;
background-color: ivory;
margin: 25px;
padding: 25px;
box-shadow: 6px 6px 6px rgba(0,0,0,0.3);
}
This is an optional challenge.
You can skip it if you like.
OPTIONAL:
76. 2019 Copyright Code for Change | Ultimate Growth 76
www.codejika.com
Now we’re going to add
content to the cards.
77. Add 3 content elements to the “Cards”.
1. Add an icon class & div.
2. Write the content.
3. Insert a button & style it.
. . .
MISSION
This mission will include 7 lengthy challenges.
2019 Copyright Code for Change | Ultimate Growth 77
www.codejika.com
82. Add a <h3> sub-title and a <p> of
explainer text in each <article>.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 82
www.codejika.com
<h3>David Mukhura</h3>
<p>Jnr. Web Developer - Creates
simple, beautiful websites for
businesses in Soweto.</p>
Below the icons </div>
closing tag.
WHERE:
EXAMPLE:
83. Add a <button> and closing tag
</button> with the text “Contact”
in the middle.
Do this in each <article>.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 83
www.codejika.com
<button> Contact </button>
Below the </p> closing
tag.
WHERE:
EXAMPLE:
84. Add a <button> and closing tag
</button> with the text “Contact”
in the middle.
Do this in each <article>.
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 84
www.codejika.com
<button> Contact </button>
Below the </p> closing
tag.
WHERE:
EXAMPLE:
85. BRIEFING Style Multiple Classes
1.1.2
Style Multiple Classes
2019 Copyright Code for Change | Ultimate Growth 85
www.codejika.com
You can style multiple classes with
the same code. Just separate
them with a comma.
.button, .container {
margin: 10px;
}
EXAMPLE:
86. Style the <button> tag and the
.button class with this CSS:
Note: We’ll use the class later.
CODE:
CHALLENGE
STEP 6
2019 Copyright Code for Change | Ultimate Growth 86
www.codejika.com
button, .button {
background: royalblue;
border: 0;
color: white;
}
91. Add another class to <section> tag:
blue
BONUS
CHALLENGE
2019 Copyright Code for Change | Ultimate Growth 91
www.codejika.com
CLASSY BLUE
25 POINTS
<section class="blue container">
CODE: 1 of 2
STEP 1
TIP:
Add a space between blue
and container.
92. Add this class.
BONUS
CHALLENGE
2019 Copyright Code for Change | Ultimate Growth 92
www.codejika.com
.blue {
background: teal;
}
CODE: 2 of 2
STEP 2
CLASSY BLUE
25 POINTS
93. 2019 Copyright Code for Change | Ultimate Growth 93
www.codejika.com
WELL DONE!
This was a long, hard lesson.
94. What is flex for?
QUIZ
It allows you to organize content simply.
It’s a body building technique.
Flexbox is a way of creating boxes.
All of the above.
QUESTION 3.2.1
A.
B.
C.
D.
1. 2.
2019 Copyright Code for Change | Ultimate Growth 94
www.codejika.com
ANSWER: NEXT SLIDE
95. What’s RGBA?
A type of HTML color code.
Red, green, blue & alpha.
Allows adding transparency to boxes.
All of the above.
QUESTION 3.2.2
A.
B.
C.
D.
1. 2.
PREVIOUS ANSWER: A.
QUIZ
2019 Copyright Code for Change | Ultimate Growth 95
www.codejika.com
96. 1. 2.
PREVIOUS ANSWER: D.
WHAT WAS YOUR SCORE?
50% 100%
QUIZ
2019 Copyright Code for Change | Ultimate Growth 96
www.codejika.com
97. If you have internet:
Download and install a
better code editor.
WHY?
It’s easier and shows any
mistakes in your code.
2019 Copyright Code for Change | Ultimate Growth 97
www.codejika.com
https://notepad-plus-plus.org/download/
We recommend:
Notepad++
FOLLOW THE LINK:
SUGGESTION:
99. 2019 Copyright Code for Change | Ultimate Growth 99
www.codejika.com
#CODEJIKA
Post on Social Media what you’re
working on with #CodeJIKA .
Help other kids learn to code.
101. PROJECT 3:
You’ll create a website for a
Small Business with an
simple order form and a few
lines of JavaScript.
PROJECT 3
Training 3
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 101
www.codejika.com
Desktop – v6
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A LANGUAGE OF SOUTH AFRICA.
103. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
4. Automatic Order Summary with JavaScript.
2019 Copyright Code for Change | Ultimate Growth 103
www.codejika.com
5. Footer, TEAM section & content writing.
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
104. 2019 Copyright Code for Change | Ultimate Growth 104
www.codejika.com
JAMBO*.
*”Hello” in Swahili.
105. 1. Build tables.
2. Create a form from a table.
3. Add some buttons.
TRAINING SNAPSHOT
These are your missions for today:
PROJECT 3 – TRAINING 3
2019 Copyright Code for Change | Ultimate Growth 105
www.codejika.com
106. Build tables.
. . .
MISSION
This mission will include 4 challenges.
2019 Copyright Code for Change | Ultimate Growth 106
www.codejika.com
108. BRIEFING <table>
Tables consist of;
A. Columns <th>
B. Rows <tr>
1.1.2
HTML Table
2019 Copyright Code for Change | Ultimate Growth 108
www.codejika.com
Example: HTML Table
Column 1 Column 3
Row 2
Row 3
COLUMN
ROW
109. BRIEFING <table>
Tables are a great way to store and
show information.
Tables can also structure content, in a web
form, for example.
1.1.2
HTML Table
2019 Copyright Code for Change | Ultimate Growth 109
www.codejika.com
Example: HTML Table
Name Age Phone
Themba 14 074 7858588
John 18 098 5211611
Rachael 17 062 3241279
113. 2019 Copyright Code for Change | Ultimate Growth 113
www.codejika.com
Let’s make a new <section>
with a table in it.
114. Create a new <section>
with an <h2> sub-title in it.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 114
www.codejika.com
<section>
<h2> MY ORDER FORM: </h2>
</section>
Below section with
“Cards.”
WHERE:
116. Add two more rows:
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 116
www.codejika.com
...
<tr>
<td> Favourite drink: </td>
<td> </td>
</tr>
<tr>
<td> Quantity: </td>
<td> </td>
</tr>
...
After row 2 and before
the </table> closing.
WHERE:
ROW 3
ROW 4
117. 2019 Copyright Code for Change | Ultimate Growth 117
www.codejika.com
BOOM!
You just built your first table.
118. 1. Pad table cells with 10px.
2. Center <table>.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 118
www.codejika.com
td {
padding: 10px;
}
table {
margin: auto;
}
You should know where
by now. ;)
WHERE:
119. Add a form to a table.
. . .
MISSION
This mission will include 6 challenges.
2019 Copyright Code for Change | Ultimate Growth 119
www.codejika.com
120. BRIEFING <form>
Form is used to collect user*
input*.
1.1.2
HTML Form
2019 Copyright Code for Change | Ultimate Growth 120
www.codejika.com
Example: HTML Form
GOOFY FORM:
What’s the silliest idea you have ever had?
Submit
Definitions:
*User : Anyone who uses
your website.
*Input : Information
given.
121. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 121
www.codejika.com
<form>
<h1>GOOFY FORM:</h1>
What’s the silliest idea you have ever had?
<br>
<input type="text" size="50">
<br><br>
<button>Submit</button>
</form>
Example: Simple HTML Form
INPUT 1
SUBMIT BUTTON
<form>
HTML Form
122. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 122
www.codejika.com
<form
id="my-form"
action="me.html"
target="_blank"
>
Example: Form Actions
CSS ID styling #my-form
<form action="">
Form Actions
Where data is sent
_blank = new tab
_self = same page
123. Wrap the whole table in
<form> tags.
• With the id="my-form" .
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 123
www.codejika.com
<form id="my-form" >
... table ...
</form>
124. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 124
www.codejika.com
<input type="text"
size="50"
name="idea"
value="Idea..." >
Example: Form Inputs
Types: Text, radio & submit.
Placeholder text.
<input>
Form Inputs
Width input field in px.
Name for saving information.
126. Insert an <input> in the
second cell ( <td> ) of the first
row.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 126
www.codejika.com
<tr>
<td>Name:</td>
<td><input type="text" size="25"
name="my-name"></td>
</tr>
127. Insert an <input> in the
second cell ( <td> ) of the
second row.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 127
www.codejika.com
<tr>
<td>Address:</td>
<td><input type="text" size="25"
name="my-address"></td>
</tr>
128. 2019 Copyright Code for Change | Ultimate Growth 128
www.codejika.com
AMAZING!
You are “Acing” this <form> thing.
129. Insert a <select> option in the
second cell ( <td> ) of the third row.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 129
www.codejika.com
<tr>
<td>Favourite drink:</td>
<td>
<select name="my-drink">
<option> Milk </option>
<option> Coffee </option>
<option> Tea </option>
</select>
</td>
</tr>
130. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 130
www.codejika.com
Example: Form Type Number
<form type="number">
Form Type Number
type="number" allows to limit the
numbers the user can choose.
<input type="number" name="my-qty"
value="1" min="1" max="5">
DEFAULT*
VALUE
MINIMUM
VALUE
MAXIMUM
VALUE
DEFINITION:
*Default : The standard. This
value remains in effect unless
changes are made.
131. In ROW 4, add a “number” type of
<input> .
Define a minimum of 1 and a maximum of 5.
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 131
www.codejika.com
<tr>
<td>Quantity:</td>
<td>
<input type="number" name="my-qty"
value="1" min="1" max="5">
</td>
</tr>
132. Add a short note below the <input> to
notify the user of the limits.
Make it <small> with HTML.
CODE:
CHALLENGE
STEP 6
2019 Copyright Code for Change | Ultimate Growth 132
www.codejika.com
<td>Quantity:</td>
<td>
<input type="number" name="my-qty"
value="1" min="1" max="5">
<small>(max 5)</small>
</td>
133. 2019 Copyright Code for Change | Ultimate Growth 133
www.codejika.com
GOOD JOB!
You’ve just added an awesome form to
the table.
134. 2019 Copyright Code for Change | Ultimate Growth 134
www.codejika.com
Almost done.
Now just add a “Submit”
button.
135. Add some buttons to the form.
. . .
MISSION
This mission will include 6 challenges.
2019 Copyright Code for Change | Ultimate Growth 135
www.codejika.com
136. Add two rows.
• We need a bit of space, so add a <br> in the
fifth ROW (below the “Quantity:” ROW. )
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 136
www.codejika.com
</tr>
<tr>
<br>
</tr>
<tr>
</tr>
</table>
ROW 5
ROW 6
137. Merge two cells in the 6 ROW together
using: <td colspan="2" >
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 137
www.codejika.com
</tr>
<tr>
<br>
</tr>
<tr>
<td colspan="2" >
</td>
</tr>
</table>
ROW 5
ROW 6
138. Add a button in ROW 6 using
type="button" and a value of
“Process Order”.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 138
www.codejika.com
<tr>
<td colspan="2" >
<input
type="button"
value="Process Order" >
</td>
</tr>
ROW 6
139. Add a second button with
type="reset" and a value of “Clear”.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 139
www.codejika.com
<tr>
<td colspan="2" >
<input
type="button"
value="Process Order" >
<input type="reset" value="Clear" >
</td>
</tr>
140. 2019 Copyright Code for Change | Ultimate Growth 140
www.codejika.com
DO YOU REMEMBER?
You’ll link to that styling in the
next Challenge.
In Training 2, you styled:
button, .button {...
141. Add styling to BOTH the buttons using
class="button" .
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 141
www.codejika.com
<td colspan="2" >
<input class="button"
type="button"
value="Process Order" >
<input class="button"
type="reset"
value="Clear" >
</td>
ROW 6
Within the <input>
tags themselves.
WHERE:
142. 2019 Copyright Code for Change | Ultimate Growth 142
www.codejika.com
CHECK
To make sure your buttons
are reflecting the styling
correctly.
143. DEBUG
There should be a HTML file in the folder
with all the code for Training 1 -3.
File: CodeJIKA_Project3_T3_v191.html
Go and check there if your code has
some problems and that haven’t figured
out yet.
2019 Copyright Code for Change | Ultimate Growth 143
www.codejika.com
COMPARE YOUR CODE
145. 2019 Copyright Code for Change | Ultimate Growth 145
www.codejika.com
You’ve written over 150 lines
of code in this PROJECT.
146. 2019 Copyright Code for Change | Ultimate Growth 146
www.codejika.com
We think that’s something
to celebrate about.
147. 2019 Copyright Code for Change | Ultimate Growth 147
www.codejika.com
Show your friends
what your site looks like.
Use: #codejika
So that we can see too.
148. What is input action for?
QUIZ
Allows the form to save submitted content.
Uses _blank to clear the form when done.
Says where to show the results of the form.
All of the above.
QUESTION 2.1.1
A.
B.
C.
D.
1. 2.
2019 Copyright Code for Change | Ultimate Growth 148
www.codejika.com
ANSWER: NEXT SLIDE
149. What are input types?
Radio, number, text, date & much more.
Variable, type, style, action
Text, number, value, button
Value, button, submit, text & reset.
QUESTION 2.1.2
A.
B.
C.
D.
1. 2.
PREVIOUS ANSWER: C.
QUIZ
2019 Copyright Code for Change | Ultimate Growth 149
www.codejika.com
150. 1. 2.
PREVIOUS ANSWER: A.
WHAT WAS YOUR SCORE?
50% 100%
QUIZ
2019 Copyright Code for Change | Ultimate Growth 150
www.codejika.com
151. It’s time for Training 4
and some JavaScript.
2019 Copyright Code for Change | Ultimate Growth 151
www.codejika.com
Are you ready?
153. PROJECT 3:
Build an awesome website
for a Small Business with a
simple JavaScript order
form.
PROJECT 3
Training 4
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 153
www.codejika.com
Desktop – v18 2019
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.
154. 2019 Copyright Code for Change | Ultimate Growth 154
www.codejika.com
#CODEJIKA
Post on Social Media what you’re
working on with #CodeJIKA .
Help other kids learn to code.
156. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
4. JS | Send & receive information from HTML.
2019 Copyright Code for Change | Ultimate Growth 156
www.codejika.com
5. JS | Add input from form and play hide & seek.
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
6. Footer, TEAM section & content writing.
157. 2019 Copyright Code for Change | Ultimate Growth 157
www.codejika.com
MORNING.
So glad you’re here today.
158. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 158
WHAT’S
JavaScript?
JavaScript is the programming
language of HTML and the Web.
160. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 160
CaPiTaLs matter.
If you get one “CAPITAL” letter wrong
ALL your code might not work.
161. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 161
Going forward, we’ll
just call it “JS”.
It’s shorter and easier.
JavaScript = JS
162. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 162
WHAT IF I DON’T UNDERSTAND?
Don’t worry.
Today is just a quick intro.
JS will be explained more in PROJECT 4.
163. 1. Link a HTML Event & JS Function.
2. Create the order summary section.
3. Send results: Variable & HTML Method.
TRAINING SNAPSHOT
Missions for today.
PROJECT 3 – TRAINING 4
2019 Copyright Code for Change | Ultimate Growth 163
www.codejika.com
Create an automatic order summary:
164. Link a HTML Event & JS Function.
. . .
MISSION
This mission will include 4 challenges.
2019 Copyright Code for Change | Ultimate Growth 164
www.codejika.com
166. BRIEFING JavaScript | <script>
1.1.2
JavaScript
2019 Copyright Code for Change | Ultimate Growth 166
www.codejika.com
THIS IS
IMPORTANT:
JavaScript is written between
<script> tags.
<script>
JavaScript Code
</script>
WHERE:
At the end of site before </body> closing tag.
167. Add script tags before the
closing </body> tag.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 167
www.codejika.com
<script>
</script>
</body>
169. BRIEFING HTML Events
Connect user actions on the
website to JavaScript (& other
things.)
1.1.2
HTML Events
2019 Copyright Code for Change | Ultimate Growth 169
www.codejika.com
An HTML Event is where
JS comes to make
connections (friends).
170. HTML Event TYPES
REFERENCE 1.1.2
HTML EVENT TYPES
2019 Copyright Code for Change | Ultimate Growth 170
www.codejika.com
HTML EVENT TYPES
onclick Fires on a mouse click on the element
onkeypress Fires when a user presses a key
onmousemove
Fires when the mouse pointer is moving while it
is over an element
onload Fires after the page is finished loading
onoffline
Script to be run when the browser starts to work
offline
onresize Fires when the browser window is resized
oninput Script to be run when an element gets user input
More online here:
https://www.w3schools.com/ta
gs/ref_eventattributes.asp
CONTENT
Note: these are just a few. There are many more.
171. onclick=""
2019 Copyright Code for Change | Ultimate Growth 171
www.codejika.com
When mouse is clicked.
BRIEFING 1.1.2
HTML Event: onclick
When someone clicks this
button (or image) then run
this JavaScript function.
172. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 172
EXAMPLE:
A HTML Event will trigger a JS Function
…when button is clicked.
BRIEFING 1.1.2
HTML Event: onclick
173. BRIEFING 1.1.2
HTML Event: onclick
2019 Copyright Code for Change | Ultimate Growth 173
www.codejika.com
3-STEP EXAMPLE:
onclick event
in button.
Triggers
function placeOrder().
Function placeOrder()
is run.
<input class="button"
type="button"
value="Process Order"
onclick="placeOrder();" >
<script>
function placeOrder() {
}
</script>
1.
2.
3.
onclick=""
174. Add the onclick HTML Event to
the “Process Order” <input> with
placeOrder() function.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 174
www.codejika.com
<input class="button"
type="button"
value="Process Order"
onclick="placeOrder();" >
176. BRIEFING JS | function
1.1.2
2019 Copyright Code for Change | Ultimate Growth 176
www.codejika.com
IT WORKS LIKE THIS: Name
function placeOrder () { }
FUNCTION
Calculations go in here.
It makes things happen.
JS | Function
180. Add a success message inside the
function using:
results = "<h3>Success</h3>…";
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 180
www.codejika.com
function placeOrder () {
results = "<h3>Success!</h3> Here is your order.";
}
183. Create the order summary section.
. . .
MISSION
This mission will include 2 challenges.
2019 Copyright Code for Change | Ultimate Growth 183
www.codejika.com
184. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 184
LINK THE MASTERS
An ID to a <div> & a var.
MISSION BRIEFING P3.T4.M2
HTML
CSS JS
#my-order
185. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 185
Function CSS ID
BRIEFING 1.1.2
JS | Variable
…to send the results to div.
Variable 2
uses
<div ID>
Styling.
STRUCTURE:
186. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 186
www.codejika.com
Like a CSS class, just with a #
instead of . (dot.)
CSS | id
CSS | id
#my-order { }
<div id="my-order">
</div>
HTML
CSS
187. Create a CSS ID called “my-order”
with this styling:
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 187
www.codejika.com
#my-order {
background-color: #29C1C4;
padding: 25px;
}
Of course, in the CSS
<style> section.
WHERE:
188. Create a <div> with an “my-
order” id inside.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 188
www.codejika.com
</tr>
</table>
<br>
<div id="my-order">
</div>
</form>
Immediately before the
</form> closing tag.
WHERE:
190. Send results: Variable & HTML Methods.
. . .
MISSION
This mission will include 3 challenges.
2019 Copyright Code for Change | Ultimate Growth 190
www.codejika.com
191. JS | var
2019 Copyright Code for Change | Ultimate Growth 191
www.codejika.com
A vehicle to store data and
give commands.
BRIEFING 1.1.2
JS | Variable
“Yaay. I love learning.”
“Get me some food.”
STORE DATA:
GIVE COMMANDS:
VARIABLE
192. BRIEFING JS | var
1.1.2
2019 Copyright Code for Change | Ultimate Growth 192
www.codejika.com
IT WORKS LIKE THIS: Variable
var store = "I like cats."
VARIABLE
Variable Name
Every variable starts with var
and has a name.
Data to store
JS | Variable
193. BRIEFING 1.1.2
2019 Copyright Code for Change | Ultimate Growth 193
www.codejika.com
Variable
var store = input from all sorts of
sources…
Variable name
Variables can store data from tons
of places.
Data to store
JS | var
JS | Variable
IT WORKS LIKE THIS:
VARIABLE
194. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 194
Variables can also store data typed
in a form.
Why would I want to store that?
Because maybe we want to show
it later in a different format or
send it to someone.
BRIEFING 1.1.2
JS | var
JS | Variable
195. CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 195
www.codejika.com
function placeOrder() {
results = "<h3>Success!</h3> Here is your order.";
var orderResults =
}
Add a JS variable called
orderResults in the
function.
197. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 197
var orderResults = document.getElementById("my-order");
Variable: To send or pull data I need two things;
1. HTML Method to pull data.
2. Say from where ( what ID ).
198. BRIEFING HTML Methods
Connect JS data and results
with HTML.
1.1.2
HTML Methods
2019 Copyright Code for Change | Ultimate Growth 198
www.codejika.com
HTML Methods are Heros
with super-powers that
help all the parts of the
site talk to each other.
199. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 199
gEBI
BRIEFING
1.1.2
HTML Methods
A. Link to the ID name.
Variable 2
asks
</div ID>
HEROS WITH SUPER-POWERS.
INNER
B. Show the results in HTML.
200. BRIEFING 1.1.2
HTML Method: gEBI
2019 Copyright Code for Change | Ultimate Growth 200
www.codejika.com
get
Element
By
Id
Hi, my name is
gEBI.
I am a HTML
Method.
.getElementById()
MY SUPER-POWER:
I create a link-up to send or pull
information from anywhere, on a
webpage or the internet.
FOR EXAMPLE:
Link variable to <div> with the
id="my-order" .
document.getElementById("my-order");
202. Add gEBI ( getElementById ) to send
results to ID: "my-order".
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 202
www.codejika.com
function placeOrder() {
results = "<h3>Success!</h3> Here is your order.";
var orderResults = document.getElementById("my-order");
}
203. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 203
GREAT WORK!
We’ve linked the var to the div.
Now we need to say what we want to send.
204. BRIEFING 1.1.2
Method: innerHTML
2019 Copyright Code for Change | Ultimate Growth 204
www.codejika.com
Hi, my name is
Inner.
I am a HTML
Method.
.innerHTML =
MY SUPER-POWER:
I can send information to
anywhere on the webpage.
FOR EXAMPLE:
Send “results” with var
orderResults which gEBI linked
to id:"my-order" .
orderResults.innerHTML = results;
InnerHTML
205. Use Inner to show “results”.
From var orderResults to the
“my-order” <div>.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 205
www.codejika.com
function order() {
results = "<h3>Success!</h3> Here is your order.";
var orderResults = document.getElementById("my-order");
orderResults.innerHTML = results;
}
206. Inner is sending the “results” to
where ever var is linked.
EXPLAINER:
2019 Copyright Code for Change | Ultimate Growth 206
www.codejika.com
function order() {
results = "<h3>Success!</h3> Here is your order.";
var orderResults = document.getElementById("my-order");
orderResults.innerHTML = results;
}
207. CHECK
1. Do you see the results
section on your website?
2. When you click the “Process
Order” button does it show
“Success!” ?
2019 Copyright Code for Change | Ultimate Growth 207
www.codejika.com
208. CHECKPOINT Your JS code should look like this:
<script>
function placeOrder() {
results = "<h3>Success</h3> Here your order.";
var orderResults = document.getElementById( "my-order" );
orderResults.innerHTML = results;
}
</script>
2019 Copyright Code for Change | Ultimate Growth 208
www.codejika.com
209. CHECKPOINT
Your CSS code
should look like this:
/* CSS ID */
#my-order {
background-color: #29C1C4;
padding: 25px;
}
/* HTML FORM BUTTON */
<input class="button"
type="button"
value="Process Order"
onclick="placeOrder();" >
2019 Copyright Code for Change | Ultimate Growth 209
www.codejika.com
213. Trigger a function with a click:
QUIZ
<div class="button"> Contact </div>
Insert in CSS: onclick="ID"
Link function to ID name in onclick event.
None of the above.
QUESTION 3.4.1
A.
B.
C.
D.
1. 2.
2019 Copyright Code for Change | Ultimate Growth 213
www.codejika.com
ANSWER: NEXT SLIDE
214. What’s a variable like?
A dog chasing a cat.
A storage box with a special name.
A boat on the ocean.
No one really knows.
QUESTION 3.4.2
A.
B.
C.
D.
1. 2.
PREVIOUS ANSWER: C.
QUIZ
2019 Copyright Code for Change | Ultimate Growth 214
www.codejika.com
215. 1. 2.
PREVIOUS ANSWER: B.
WHAT WAS YOUR SCORE?
50% 100%
QUIZ
2019 Copyright Code for Change | Ultimate Growth 215
www.codejika.com
216. It’s time for Training 5
You will add some content to
your JS program.
2019 Copyright Code for Change | Ultimate Growth 216
www.codejika.com
Are you ready?
217. 2019 Copyright Code for Change | Ultimate Growth 217
www.codejika.com
• Learn to code.
• Start a Coding League.
• Partner with us.
• Help other people.
• Tell us how we can improve.
• Use: #CodeJIKA on all posts &
publications.
DO: DON’T:
• Say you’ve started a coding
program and not mention
#CodeJIKA.
• Modify our material or say it’s
your own.
• Issue press releases without
mentioning #CodeJIKA .
• Be a stinky-poo.
THE RULES:
219. PROJECT 3:
Build an awesome website
for a Small Business with a
simple JavaScript order
form.
PROJECT 3
Training 5
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 219
www.codejika.com
Desktop – v3 2019
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.
221. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
4. JS | Send & receive information from HTML.
2019 Copyright Code for Change | Ultimate Growth 221
www.codejika.com
5. JS | Add input from form & play hide & seek.
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
6. Footer, TEAM section & content writing.
222. 2019 Copyright Code for Change | Ultimate Growth 222
www.codejika.com
BOM DIA*.
*Portuguese: Good morning.
223. 1. Link variable to <form>.
2. List user responses from <form>.
3. Play hide and seek with the results section.
TRAINING SNAPSHOT
Missions for today.
PROJECT 3 – TRAINING 4
2019 Copyright Code for Change | Ultimate Growth 223
www.codejika.com
Create an automatic order summary:
224. Link variable to <form>.
. . .
MISSION
This mission will include 1 challenge.
2019 Copyright Code for Change | Ultimate Growth 224
www.codejika.com
225. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 225
Pull user responses
from the form
into the
var orderForm .
226. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 226
1. HTML Method to pull data.
var orderForm = document.getElementById("my-form");
2. Say from where ( what ID ).
To pull data into a variable we need two things;
227. Create a new var called orderForm
and using gEBI, link it to the “my-
form” ID.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 227
www.codejika.com
function order() {
var orderForm = document.getElementById("my-form");
results = "<h3>Success!</h3> Here is your order.";
var orderResults = document.getElementById("my-order");
}
228. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 228
TIP:
Make sure the new var is:
A. On the first line of function.
B. Within { } curly brackets.
229. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 229
NICE.
Now for the most exciting part:
Add the details from the
<form> to the orderForm var
230. List user responses from <form>.
. . .
MISSION
This mission will include 5 challenges.
2019 Copyright Code for Change | Ultimate Growth 230
www.codejika.com
231. Add a <br> and a caption “Name: “
to the results using results += .
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 231
www.codejika.com
var orderForm = document.getElementById("my-form");
results = "<h3>Success!</h3> Here is your order.";
results += "<br>Name: "
var orderResults = document.getElementById("my-order");
orderResults.innerHTML = results;
Before var orderResults .
WHERE:
232. Use ID my-name and .value to pull
the input.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 232
www.codejika.com
results = "<h3>Success!</h3> Here is your order.";
results += "<br>Name: " + orderForm.elements["my-name"].value;
Use + and always end with ;
semi-colon.
TIP:
233. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 233
TIP:
A. Use += and always end with ; .
B. Also, note we’re using [ ] brackets.
234. CHECK
1. Is the “Name” input from the form
showing in the results?
( After you click “Process Order” button. )
2019 Copyright Code for Change | Ultimate Growth 234
www.codejika.com
TIP: Use the F5 key to refresh your page.
238. Repeat with:
Caption: "<br>Quantity: "
ID: my-qty
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 238
www.codejika.com
results = "<h3>Success!</h3> Here is your order.";
results += "<br>Name: " + orderForm.elements["my-name"].value;
results += "<br>Address: " + orderForm.elements["my-address"].value;
results += "<br>I like to order: " + orderForm.elements["my-
drink"].value;
results += "<br>Quantity: " + orderForm.elements["my-qty"].value;
239. Play hide and seek with the results
section.
. . .
MISSION
This mission will include 7 challenges.
2019 Copyright Code for Change | Ultimate Growth 239
www.codejika.com
240. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 240
OK.
Now, we want to hide the
results section until the order
is submitted.
241. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 241
1. Put a display: none; into the CSS ID.
(This hides the section.)
orderResults.style.display = "block";
2. Override with HTML style once button is clicked.
(This shows the section.)
How will we do that?
242. Hide the results by adding
display: none; to the CSS
#my-order ID.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 242
www.codejika.com
#my-order {
background-color: #29C1C4;
padding: 25px;
display: none;
}
243. BRIEFING 1.1.2
HTML: Style Display
2019 Copyright Code for Change | Ultimate Growth 243
www.codejika.com
Hi, my name is
Styl.
I am a HTML
DOM.
.style.display =
MY SUPER-POWER:
I can make information appear
or disappear anywhere on the
webpage.
FOR EXAMPLE:
In var orderResults I can use
“block” or “none” to make results
show or hide.
orderResults.style.display = "block";
Style.display
244. Use Styl to make the hidden
results appear.
In var orderResults.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 244
www.codejika.com
var orderResults = document.getElementById("my-order");
orderResults.style.display = "block";
orderResults.innerHTML = results;
Before innerHTML.
WHERE:
245. CHECK
1. Is the results section hidden
on the webpage?
2. When you click the “Process
Order” button does show?
2019 Copyright Code for Change | Ultimate Growth 245
www.codejika.com
TIP: Use the F5 key to refresh your page.
250. BREAK-DOWN 1.1.2
P3 Training 4
2019 Copyright Code for Change | Ultimate Growth 250
www.codejika.com
Event inside button.
Button click runs function.
onclick="placeOrder();"
1.
2.
4.
function placeOrder() {
}
var orderResults = var sends data to <div>.
<div id="my-order"> <div> shows results.
5.
3. var orderForm = var pulls user info.
MY PROGRAM:
251. A. Add the line ( button ) .
B. Figure out what each part does.
TIP: Remember " at the end.
CODE:
BONUS
2019 Copyright Code for Change | Ultimate Growth 251
www.codejika.com
<input class="button" type="button" value="Process Order"
onclick="placeOrder();" >
<input class="button" type="reset" value="Clear"
onclick="document.getElementById('my-order').style.display = 'none'"; >
JS APPRENTICE
200 POINTS
252. www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 252
TIP:
Notice there are:
A. ( ' ) Single quotes.
B. ( " ) Double quotes.
254. getElementById
QUIZ
Collects information from CSS.
Is an HTML form element to send user data.
Get info from an element in your document.
All of the above.
QUESTION 3.5.1
A.
B.
C.
D.
1. 2.
2019 Copyright Code for Change | Ultimate Growth 254
www.codejika.com
ANSWER: NEXT SLIDE
255. InnerHTML
Links user data with JS functions.
Allows a form to show anywhere.
Sets/returns HTML content of an element.
A compound JS term to confuse you.
QUESTION 3.5.2
A.
B.
C.
D.
1. 2.
PREVIOUS ANSWER: C.
QUIZ
2019 Copyright Code for Change | Ultimate Growth 255
www.codejika.com
256. 1. 2.
PREVIOUS ANSWER: C.
WHAT WAS YOUR SCORE?
50% 100%
QUIZ
2019 Copyright Code for Change | Ultimate Growth 256
www.codejika.com
257. Training 6 is really easy
and it’s the last one.
2019 Copyright Code for Change | Ultimate Growth 257
www.codejika.com
Are you ready?
259. PROJECT 3:
Build an awesome website
for a Small Business with a
simple JavaScript order
form.
PROJECT 3
Training 6
PURPOSE:
Teach yourself. Teach your
friends. Help others.
LEARN:
The practical skills of a
Junior Web Developer over
12 Projects.
WHAT’S THE DEAL?
LEARN MORE: www.CODEJIKA.com
CODEJIKA.COM
2019 Copyright Code for Change | Ultimate Growth 259
www.codejika.com
Desktop – v6
PRONOUNCED: CODE–GEE-KA
JIKA MEANS “DANCE” OR TURN IN ZULU, A LANGUAGE OF SOUTH AFRICA.
261. 1. Setup: Header & Business Info
2. Learn Flex, add “Cards” & content.
3. Build tables & add a form.
4. JS | Send & receive information from HTML.
2019 Copyright Code for Change | Ultimate Growth 261
www.codejika.com
5. JS | Add input from form and play hide & seek.
PROJECT 3 – SIMPLE BIZ WEBSITE
TRAINING SESSIONS:
6. Footer, TEAM section & content writing.
262. 1. Create a stylish footer.
2. Write content for the business.
3. Add a “Team” section.
TRAINING SNAPSHOT
These are your missions for today.
PROJECT 3 – TRAINING 6
2019 Copyright Code for Change | Ultimate Growth 262
www.codejika.com
Create footer and add more content.
263. Create a stylish footer.
. . .
MISSION
This mission will include 8 challenges.
2019 Copyright Code for Change | Ultimate Growth 263
www.codejika.com
264. Create a class called “footer”
with 30px padding and a grey
background.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 264
www.codejika.com
TIP:
padding: ???;
background: ???;
265. Create a <div> and link it to
.footer class styling.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 265
www.codejika.com
WHERE:
Immediately above the <script> section.
266. Write this in the <div> in an
h3 tag:
Thanks for visiting.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 266
www.codejika.com
WHERE:
In the <div> you just created.
267. 2019 Copyright Code for Change | Ultimate Growth 267
www.codejika.com
KEEP IT UP!
268. 1. Make another <div> inside
the <div> you just created.
2. Apply the .container class
styling to it.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 268
www.codejika.com
WHERE:
Immediately below the </h3> closing.
269. 1. Create two <article>s in the
same <div>.
2. Style both with the “.card” class.
CODE:
CHALLENGE
STEP 5
2019 Copyright Code for Change | Ultimate Growth 269
www.codejika.com
TIP:
Make sure to close the first one before opening
the next one.
271. Add this in the first <article>:
In <h3>: Get in Touch.
In <p>: Probably the best
place to buy cupcakes in all
of Joburg.
CODE:
CHALLENGE
STEP 6
2019 Copyright Code for Change | Ultimate Growth 271
www.codejika.com
272. Add this to the second <article>:
In H3: Contact Us:
In p:
We would love to hear from you.
<br> Call or email us. <br>
Mobile: 072345 633 //
Tel: 012 343 3432
CODE:
CHALLENGE
STEP 7
2019 Copyright Code for Change | Ultimate Growth 272
www.codejika.com
274. 2019 Copyright Code for Change | Ultimate Growth 274
www.codejika.com
FOOTER COMPLETE.
Hop on one foot to celebrate.
275. 2019 Copyright Code for Change | Ultimate Growth 275
www.codejika.com
DESIGN
OVERVIEW:
It should look something like this.
Feel free to swap the color and, of
course, change the text.
276. Define the services of the business.
. . .
MISSION
This mission will include 1 VERY IMPORTANT bonus
challenge.
2019 Copyright Code for Change | Ultimate Growth 276
www.codejika.com
277. 2019 Copyright Code for Change | Ultimate Growth 277
www.codejika.com
Learn about your client
Who are you making the website for?
Explain their business well.
Use engaging Photos and text.
TIP: Ask a friend to edit your text or shoot
photos for you.
WANNA BE A GREAT WEBDESIGNER?
BUSINESS COACH:
278. BRIEFING CONTENT CREATION:
Content is a boring name for
awesome stuff.
Content =
1.1.2
CONTENT CREATION
2019 Copyright Code for Change | Ultimate Growth 278
www.codejika.com
Videos.
Photos.
GIFs.
Poems.
Explanations.
Any other type of text.
279. BUSINESS COACH:
2019 Copyright Code for Change | Ultimate Growth 279
www.codejika.com
“I created a checklist to
help you discover and
write about what the
best part of the
business.”
NOTE: This is in your folder as a PDF or you can
download from www.codejika.com .
WEBSITE CONTENT CHECKLIST:
280. 2019 Copyright Code for Change | Ultimate Growth 280
www.codejika.com
CODEJIKA.COM
LEVEL 1: BUSINESS WEBSITE CONTENT LIST
1.WARM-UP:
What is the purpose of your business?
What is special about your business?
What is the most important product or service in your business?
Why did you start this business?
2.CORE:
How do you describe your business in one sentence?
Option 1. ___________________________________________________________________
Option 2. ___________________________________________________________________
When was the business started? ___________
How many clients do you have? (Per month or in total.) ___________
3.DETAILS:
Address: ___________________________________________________________
Phone: ___________________________________________________________
Email: ___________________________________________________________
Preferred Web Domain ( Example: www.DaveDonut.com or www.CharlieIndustries.com )
1.: ___________________ 2.: ___________________ 3.:
___________________
CODEJIKA.COM
4. TEAM:
(Optional: Get a simple, friendly photo of each person’s face and shoulders.)
Person 1:
Name: ____________________________ Designation: ________________________
One sentence about what this person is good at and why:
____________________________________________
Person 2:
Name: ____________________________ Designation: ________________________
One sentence about what this person is good at and why:
____________________________________________
1.CUSTOMER REVIEWS:
(Optional: Get a simple, friendly photo of each person’s face and shoulders.)
Customer 1:
Name: ______________________ From where: ________________________
A few words about what this customer likes about business or their experience:
____________________________________________________
Customer 2:
Name: ______________________ From where: ________________________
A few words about what this customer likes about business or their experience:
____________________________________________________
281. A. Design a website for a business
( or organization, club or school.)
BUSINESS:
BONUS
CHALLENGE
2019 Copyright Code for Change | Ultimate Growth 281
www.codejika.com
SALES PRO
800 POINTS
TIPS:
The checklist is attached at the end of the lesson.
Just print those two pages.
B. Use the checklist to
create the content.
282. 2019 Copyright Code for Change | Ultimate Growth 282
www.codejika.com
NEVER, EVER meet a client alone.
Be careful and suspicious, especially of people that are overly
friendly.
You can usually get all your information over the phone or
email.
IMPORTANT:
283. Add a “Team” section.
. . .
MISSION
This mission will include 4 challenges.
2019 Copyright Code for Change | Ultimate Growth 283
www.codejika.com
284. 2019 Copyright Code for Change | Ultimate Growth 284
www.codejika.com
Create a new section of the
website by copying and
pasting a section of code.
USE IT TWICE!
285. 2019 Copyright Code for Change | Ultimate Growth 285
www.codejika.com
Then, we’ll change the content
(images and text) and the
background.
286. Duplicate: Copy and paste the
whole <section> with “OUR
SERVICES” in.
From the opening to the closing
tag.
CODE:
CHALLENGE
STEP 1
2019 Copyright Code for Change | Ultimate Growth 286
www.codejika.com
WHERE:
Paste it immediately below the first
section’s closing tag </section>.
287. Change the second section into a
“TEAM” section.
Change “OUR SERVICES” sub-title
to: “OUR TEAM”.
CODE:
CHALLENGE
STEP 2
2019 Copyright Code for Change | Ultimate Growth 287
www.codejika.com
288. Present two members of the
team (in the cards.)
1. Change the emoji code.
2. <h3>: First and Last Name.
3. <p>: Add a short bio*.
4. <button>: Remove.
CODE:
CHALLENGE
STEP 3
2019 Copyright Code for Change | Ultimate Growth 288
www.codejika.com
*DEFINITION:
“Bio” says what a
person is good at,
studied or accomplished.
289. 2019 Copyright Code for Change | Ultimate Growth 289
www.codejika.com
Now change the background color
of the section by adding a bit of
in-line styling.
GOOD!
290. Add style="background-
color: deeppink;" to the
“TEAM” <section> opening tag.
CODE:
CHALLENGE
STEP 4
2019 Copyright Code for Change | Ultimate Growth 290
www.codejika.com
<section class="container" style="background-color:
deeppink;">
291. CHECK The “Team” section can look something like this.
2019 Copyright Code for Change | Ultimate Growth 291
www.codejika.com
292. 1. Create a another new section
for the website.
2. Decide what title and content
should be there.
CONTENT:
BONUS
CHALLENGE
2019 Copyright Code for Change | Ultimate Growth 292
www.codejika.com
CONTENT BOSS
45 POINTS
1 of 2
STEP 1
293. CHECK:
2019 Copyright Code for Change | Ultimate Growth 293
www.codejika.com
CONTENT BOSS
45 POINTS
It should have 3 <section> s with
cards and content.
Make sure emojis (or photos) sub-
title and paragraph are all unique
in each section.
BONUS
CHALLENGE
2 of 2
STEP 2
298. You just finished PROJECT 3.
That’s AMAZING.
You should celebrate!!!
2019 Copyright Code for Change | Ultimate Growth 298
www.codejika.com
299. 2019 Copyright Code for Change | Ultimate Growth 299
www.codejika.com
Post what you would improve
on Social Media or email us.
HOW CAN WE
DO BETTER?
Use the hashtag #CodeJIKA .