In lab 3, we learned how to create a alert box using JavaScript. We had to create three level 3 questions about what we learned about JavaScript so far. When, someone clicks on the question, a alert box will pop up with the answer and the user have to click "ok" to continue. We had to attract our JavaScript coding to our HTML document.
We created the alert box by creating the button id (clicker1, clicker2, clicker3). We had to change the names of the buttons also (oButton, oButton2, oButton3) and the function name (behave, panda, bear). For example, for question 1 which is 'clicker1' and the function name is "behave". When, a person clicks on question 1, the function "behave" tells what to do when the button is clicked. The function "behave" pops up an alert box that tells the answer to the question. I can use this skill in the future to create alert boxes to get information to the user and they can click "ok" to continue.
No comments:
Post a Comment