123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <!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>
|