Challenge Hints: Functions for Buttons

A list of hints for the challenges in the Functions for Buttons lesson.

Last updated - June 30, 2023

 

Checkpoint

Do you have a function in your onclick attribute?  Is it inside parentheses?

Did you put your JavaScript function inside of a script tag?

Does your function contain an alert?  Is it inside script tags?

Can you smell a memory?

Does your button have an onclick attribute?

Is your onclick attribute equal to "smell()"?

Do you have three different prompt functions?

Did you concatenate your three variables together inside the alert function using +?

Campfire S'mores

Did you declare a button with the onclick attribute that will call the function instructions?

Did you define your function instructions to first get the number of marshmallows that the user would like?

Did you then alert the user to start roasting that number of marshmallows?

Did you alert the remainder of instructions to the user in your function?

Beach Day

Did you create a button with the onclick attribute that calls the packingList function?

Did you create a button with the onclick attribute that calls the beachOptions function?

Did you define your function "packingList" to alert three separate times of items to take?

Did you define your function "beachOptions" to have 3 separate alerts of activities to do at the beach?

Build a Lunch

Did you declare a button that calls the function "fruit"?

Did you declare a button that calls the function "vegetable"?

Did you declare a button with the onclick attribute that calls the function "mainDish"?

Did you define your function "fruit" to prompt the user and get the fruit they want?

Did you define your function "vegetable" to prompt the user and get the vegetable they want?

Did you define your functions "mainDish" and have it prompt the user and get the main dish they want?

For more help with JavaScript, check out our Javascript Reference Guide!