Computer Science, asked by Sciences8301, 11 months ago

What happens when the following JavaScript code is executed? var get_res = confirm(""Did you like this chapter?""); if (get_res == true) alert(""Okay! Let’s go to the next!"");

Answers

Answered by Bigdahero90
0

Answer:

Lesson 1: Using JavaScript to Show an Alert

Overview

In this lesson, you will use JavaScript to display an alert after the web page has loaded.

Learner Outcomes

At the completion of this exercise, you will have learned:

how a client-side script fits within the context of an HTML page.

some basic Javascript syntax.

Activities

Answered by shilpa85475
0

Confirm box and alert box are two types of pop up boxes used in Java script.

EXPLANTION:  

  • Confirm box is used to verify an information form the user. He can confirm the same by either clicking on ‘OK’ or ‘Cancel’ buttons available on this confirm box.  
  • An alert box is small dialog box with a short message and the button OK with it. It is used to display some information to the user.
  • When it appears, the user has to click “OK” button to proceed further.
  • The statement Confirm (Did you like this chapter) will open a confirm box and the user needs to input if he liked the chapter.
  • In case the user hits OK button (as this confirm box has two buttons OK and cancel), then the next statement if (get_res==true) will be correct and then it will give an alert box saying “Okay! Let’s go to the next!”

Similar questions