1234567891011121314151617181920212223242526272829303132 |
- // Simple calories calculator-------------------------------------------------------------------------
- // let breakfastEats = +prompt("How many calories do you eat for breakfast?", []);
- // let lunchEats = +prompt("How many calories do you eat for lunch?", []);
- // let dinnerEats = +prompt("How many calories do you eat for dinner?", []);
- // let caloriesOfTheDay = breakfastEats + lunchEats + dinnerEats;
- // if (caloriesOfTheDay > 1800) {
- // alert("You are eating too many calories");
- // } else {
- // alert(
- // "Everything is fine, you did not exceed the number of calories for the day"
- // );
- // }
- // Login form--------------------------------------------------------------------------------------------
- const box = document.body;
- function Input() {
- user_name = "";
- password = "";
- user_name = prompt("Login", []);
- user_name = user_name.toLowerCase();
- password = prompt("Password", []);
- password = password.toLowerCase();
- if (user_name == "admin" && password == "qwerty") {
- box.style.backgroundColor = "green";
- } else {
- box.style.backgroundColor = "red";
- }
- }
|