Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <script type="text/javascript">
- function zwierzeta(w1,w2,w3,w4){
- this.pies =w1;
- this.kot = w2;
- this.szczur = w3;
- this.kret = w4;
- this.pokaz = function()
- {
- var tablica_1=[]
- tablica_1[0]=[w1];
- tablica_1[1]=[w2];
- tablica_1[2]=[w3];
- tablica_1[3]=[w4];
- document.write('Pierwszy element tablicy:'+tablica_1[0][0]+"<br>");
- document.write('Drugi element tablicy:'+tablica_1[1][0]+"<br>");
- document.write('Trzeci element tablicy:'+tablica_1[2][0]+"<br>");
- document.write('Czwarty element tablicy:'+tablica_1[3][0]+"<br>");
- }
- }
- function stw1()
- {
- a=document.getElementById("a1").value;
- b=document.getElementById("a2").value;
- c=document.getElementById("a3").value;
- d=document.getElementById("a4").value;
- zwierzeta = new zwierzeta(a,b,c,d);
- zwierzeta.pokaz();
- }
- </script>
- </head>
- <body>
- <input type = "text" id="a1"/>
- <input type = "text" id="a2"/>
- <input type = "text" id="a3"/>
- <input type = "text" id="a4"/>
- <input type = "submit" value= "Pokaz" onclick = "stw1()"/>
- <div id ="wynik" ></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement