boat

Javascript

interactive web design

 

Crypto Exchange

balance

1000

How much money would you like to take out?

Getting started

Watch the video to get started. You will need to download these 3 images and save them in your project folder:


TASK 1

Complete the challenges presented in the video:

  1. update myBalance: the formula is = myBalance - amount
  2. display the new balance on the web page in the correct element
  3. Figure out how to change the src attribute of the image

if the balance is greater than 500, the src attribute is threedollars.jpg

else if the balance is greater than 200, the src attribute is twodollars.jpg

else the src attribute is onedollar.jpg

Hint: research how to use if... else if... else... in Javascript.

TASK 2

Pay close attention to the simulator at the top of this page.

What happens each time you input a number and click Go!   ?

That's right, the input box clears/empties.

Can you make this happen?

TASK 3

Pay close attention to the simulator at the top of the page.

What happens if an error message appears and then you enter a new, valid amount?

That's right, the error message clears.

Can you make this happen?

SUBMISSION

Submit your project folder as instructed by your tutor.


Tags

browser file tags body save h1 html h4 h2 structure refresh h3 organised