Session 8 - Javascript
1. Copy the script and save as
operators.html
.
JavaScript Operators
JavaScript uses arithmetic operators to compute values (just like algebra).
Show different a,b,c
2. Copy the script and save as
button.html
.
JavaScript label example
Player 1: Chris
3. Choose a Team Member.
Replace the images table.
Choose a Photo
Carrie
Sally
Jevonie
Talesa
Alyssa
Modify styles.css.
button { background-color: rgb(0,0,140); /* Dark Blue */ border: none; border-radius: 15px; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 20px; margin: 4px 2px; cursor: pointer; } button:hover { background-color: rgb(255,165,0); /* Orange */ }
Create javascript.
/ * team.js */ function playImage1(){ document.getElementById('myImage').src='images/Carrie.jpg'; return true; } function playImage2(){ document.getElementById('myImage').src='images/Sally.jpg'; return true; } function playImage3(){ document.getElementById('myImage').src='images/Jevonie.jpg'; return true; } function playImage4(){ document.getElementById('myImage').src='images/Talesa.jpg'; return true; } function playImage5(){ document.getElementById('myImage').src='images/Alyssa.jpg'; return true; }
Save in assets as
team.js
.
Add link to index.html.
FSF Training
Open
Website