Skip to content

Instantly share code, notes, and snippets.

@r4z0r5
Created April 2, 2017 12:22
Show Gist options
  • Save r4z0r5/58abd2b8a8a6f734fc3d2c12ce93f42b to your computer and use it in GitHub Desktop.
Save r4z0r5/58abd2b8a8a6f734fc3d2c12ce93f42b to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<meta name="Author" content="Тетерина Алина Анатольевна">
<meta name="Description" content="ФиК 2-1 Вариант №10">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Работа №3. Знакомство с языком JS </title>
</head>
<body>
<script>
//charset=windows-1251
var v;
v=prompt("Выбирай: 1 - Изображение, 2 - Гиперссылка, 3 - Таблица", 1);
switch(v)
{
case "1": document.write('<img src="green_lemon.jpg">'); break;
case "2": document.write('<a href="f01.html">f01.html</a>'); break;
case "3": var arr=["бв","гд","жз","кл","мк","пр","ст","фх"];
var html='<table border="1" cellspacing="0" cellpadding="5">';
for (var i=0;i<arr.length;i+= 2){
html+='<td><th>'+arr[i]+ '</th><th>' + arr[i + 1]+ '</td>';
html+='</tr>';
if (i == 2 || i ==4 || i == 6 || i ==8){
html += '<br>';
}
}
html += "</table>";
document.write(html);
break;
default: document.write("Ошибка ввода"); break;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment