15. Команды alert, confirm и prompt в JavaScript

In this example below you will see how to do a 15. Команды alert, confirm и prompt в JavaScript with some HTML / CSS and Javascript

Школа веб-разработки WebCademy http://webcademy.ru/ Курс по JavaScript для начинающих https://www.youtube.com/watch?v=fqdKDqCA73E

This awesome code was written by Филипп Юрьевич Ригованов, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Филипп Юрьевич Ригованов ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>15. Команды alert, confirm и prompt в JavaScript</title>
      <link rel="stylesheet" href="css/style.css">




    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/a1ip/15-andx41aandx43eandx43candx430andx43dandx434andx44b-alert-confirm-andx438-prompt-andx432-javascript-LzbWEQ */
// alert("This is alert");
// console.log("This is console message")

// prompt("This is prompt");
// console.log(prompt("This is prompt"))

// var userName = prompt("What is your name");
// console.log(userName);

// confirm("Подтвердите своё действие");
// var answer = confirm("Подтвердите своё действие");
// console.log(answer);

var age = prompt("Enter your age");

if (age >= 18) {
    alert("Let's play MortalCombat");
} else {
    alert("Let's play Tetris");