Today #day33 of #100daysofcode, I have completed 4.28 lesson and 4.29 module 4 quiz and 4.30 "Currency converter" code project in JS course. @Sololearn
1. alert prompt confirm
i. The Alert Box
- Javascript has alert prompt confirm popup boxes.
- an alert box is used to relay information to the user.
- user must click procede in order to close the alert box, so be cautious.
- alert function only takes strings I.e texts to show to the users.
- alert() can be called with any number of arguments but it will only use/accept the first one.
- alert() his for displaying a message in a box.
ii. Prompt Box
- a prompt box is use to take user input.
- the user must click OK or cancel to exit the prompt box.
- the user clicks okay prompt will return input value hand clicking cancel will return null value.
- the prompt takes 2 parameters.
- The first is the label, which you want to display in the text box.
- The second is a default string to display in the text box (optional).
Ex:
```var user = prompt("Please enter your name",'noname?'); alert(user); ```
- prompt is for getting input from the user
Code: Click
iii. Confirm Box
- to get true or false from user use Confirm box.
- the user must click OK or cancel to proceed.
- clicking OK returns false and clicking cancel will return false.
Images of lesson completed:
Conclusion
- The Alert Box
- Prompt Box
- Confirm Box
- quiz
- code project [click]
My Code:
- Code [Click]