Browse Source

in process

Vladislav342 2 years ago
parent
commit
a51af02c98
1 changed files with 123 additions and 0 deletions
  1. 123 0
      HW_03/index.html

+ 123 - 0
HW_03/index.html

@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<meta charset="utf-8">
+	<title></title>
+</head>
+<body>
+
+	<script>
+		//html tree
+		/*let body={
+			tagName:'body',
+			attrs:{},
+			children:[
+				{
+					tagName:'div',
+					children:[
+						{
+							tagName:'span',
+							children:[
+								'Enter a data please'
+							]	
+						},
+						{
+							tagName:'input',
+							attrs:{
+								type:'text',
+								id:'name'
+							}
+						},
+						{
+							tagName:'input',
+							attrs:{
+								type:'text',
+								id:'surname'
+							}
+						}
+					]
+				},
+				{
+					tagName:'div',
+					children:[
+						{
+							tagName:'button',
+							attrs:{
+								id:'ok'
+							},
+							children:['OK']
+						},
+						{
+							tagName:'button',
+							attrs:{
+								id:'cancel'
+							},
+							children:['Cancel']
+						}
+					]
+				}
+			]
+		}
+		console.log(body.children[0].children[2].attrs.id);*/
+
+		//declarative fields
+		/*let school={
+			clasuxa:{
+				name:prompt('Name of Your classuxa',''),
+				smartphon:{
+					owner:school,
+					telephon:+prompt('telefon classuxi','')
+				},
+				laptop:prompt('','')
+			},
+			directrisa:prompt('Name of Your directrisa',''),
+			numOfSchool: +prompt('Number of your school','')
+		};
+		console.log(JSON.stringify(students,null,2));
+		*/
+
+
+		//object links
+		/*let person={
+			name:'Kiril',
+			surname:'Petrovich'
+		};
+		person.gajeti={
+			smarthon:'38073456748',
+			laptop:'Apple',
+			owner:person
+		}
+		console.log(person.gajeti.owner.gajeti);*/
+
+		//imperative array fill 3
+		/*let arr=[];
+		arr[0]=prompt('','');
+		arr[1]=+prompt('','');
+		arr[2]=+prompt('','');
+		console.log(arr);*/
+
+		//while confirm
+		/*let num=false;
+		while(num==false){
+			num=confirm(''); //постоянный confirm пока не ОК
+		}*/
+
+
+//------------------------------------------
+		//array fill
+		/*let arr=[];
+		let key=true;
+		while(key!=false){
+			key=prompt('Введите элемент массива','');
+			arr.push(key);
+		}
+		console.log(arr);*/
+		//???? при отмене записывает null в массив и продолжает спрашивать новый элемент для записи, при добавлении ||key!=null вечный цикл получается ????????
+//-------------------------------------------
+
+		//
+
+		
+	</script>
+</body>
+</html>