123456789101112131415161718 |
- <head>
- <h1>Default: if</h1>
- </head>
- <body>
- <script>
- let sName = prompt("Enter surname");
- if (!sName)
- sName = "Иванов";
- let name = prompt("Enter name");
- if (!name)
- name = "Иван";
- let fName = prompt("Enter father`s name");
- if (!fName)
- fName = "Иванович";
- alert(sName + " " + name + " " + fName);
- </script>
- </body>
|