When we click a button, we will call a function.
The function is like a little box of code that will run when it is called.
Download this webpage and save it in your Lesson 4 folder.
There is a button. When you click the button it calls a function - calculateBMI().
The function works as follows:
Code this function.
Use the following test table to test your result:
Save your solution as lesson4-1.html
Replace the button with an image of a doctor.
Under the image is a message Click me!
When the user clicks the image, the calculateBMI() function is called.
In the style section of the webpage, include the following CSS:
Save your solution as lesson4-2.html
Research how to add this to your page:
If the calculated BMI is greater than 25, a message Overweight is displayed under the BMI on the webpage.
else, a message Normal is displayed.
Save your solution as lesson4-3.html
Submit your 3 web documents (html files) as instructed by your tutor.