Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <form name="abc">
  6. <input type="text" name="imie"/>
  7. <input type="text" name="nazwisko"/>
  8. <input type="text" name="wiek"/>
  9. <input type="date" name="urodziny" min="1890-01-01" max="2019-01-01" />
  10. <input type="button" value="Pisz" onclick="pisz()">
  11. </form>
  12. <script>
  13.  
  14. function klasa(imie,nazwisko,wiek,data)
  15. {
  16. this.imie=imie;
  17. this.nazwisko=nazwisko;
  18. this.wiek=wiek;
  19. this.dataur=data
  20.  
  21. this.spr=function()
  22. {
  23. if (this.wiek>18)
  24. return "pełnoletni";
  25. else return "niepełnoletni";
  26. }
  27.  
  28. this.lata=function()
  29. {
  30. var r=new Date();
  31. var x=r.getFullYear();
  32. var y="";
  33. for(j=0;j<4;j++)
  34. y+=this.dataur.charAt(j)
  35. return x-y;
  36. }
  37.  
  38. this.pokaz=function()
  39. {
  40. return this.imie+" "+this.nazwisko+" "+this.wiek+" "+this.spr()+" "+this.lata();
  41. }
  42. }
  43.  
  44. function pisz()
  45. {
  46. i=document.abc.imie.value
  47. n=document.abc.nazwisko.value
  48. w=document.abc.wiek.value
  49. d=document.abc.urodziny.value
  50. a=new klasa(i,n,w,d)
  51. document.getElementById("id").innerHTML=a.pokaz()
  52. }
  53. </script>
  54. <div id="id"/>
  55. </body>
  56. </html>
  57. /////////////////////////
  58. <html>
  59. <head>
  60. </head>
  61. <body>
  62. <form name="abc">
  63. <input type="tekst" name="tekst"/>
  64. <input type="color" name="kolor"/>
  65. <input type="color" name="fkolor"/>
  66. <input type="range" name="rozmiar" value="16" min="5" max="30" step="1">
  67. <input type="button" value="Pisz" onclick="pisz()">
  68. </form>
  69. <script>
  70.  
  71. function font(tekst,kolor,fkolor,rozmiar,typ)
  72. {
  73. this.tekst=tekst
  74. this.kolor=kolor;
  75. this.fkolor=fkolor;
  76. this.rozmiar=rozmiar;
  77. this.typ=typ;
  78. this.zmien=function()
  79. {
  80. return "<span style='
  81. }
  82.  
  83. }
  84.  
  85. function pisz()
  86. {
  87. t=document.abc.tekst.value
  88. i=document.abc.kolor.value
  89. l=document.abc.fkolor.value
  90. n=document.abc.rozmiar.value
  91. w=document.abc.typ.value
  92. a=new font(t,i,l,n,w)
  93. a.zmien()
  94. }
  95. </script>
  96. <div id="id">JDJDJDJDJJDDJJDJDJDJ</div>
  97. </body>
  98. </html>
  99. ///////////////////
  100. <html>
  101. <head>
  102. </head>
  103. <body>
  104. <form name="form">
  105. <input type="text" name="tekst">
  106. <select name="czcionka">
  107. <option value="Calibri">Calibri</option>
  108. <option value="Arial">Arial</option>
  109. <option value="Times New Roman">Times New Roman</option>
  110. <option value="Arial Black">Arial Black</option>
  111. </select>
  112. <input type="range" name="suwak" value="16" min="5" max="30" step="1">
  113. <input type="color" name="kolor">
  114. <input type="button" onclick="wypisz()" value="Wypisz">
  115. </form>
  116. <script>
  117. function wypisz() {
  118. var tekstowo=document.form.tekst.value;
  119. var czcioneczka=document.form.czcionka.value;
  120. var suwaczek=document.form.suwak.value;
  121. var kolorek=document.form.kolor.value;
  122. document.getElementById("abc").innerHTML="<span style='font-family:"+czcioneczka+"';>"+tekstowo.fontcolor(kolorek).fontsize(suwaczek)+"</span>";
  123. }
  124. </script>
  125. <div id="abc"></div>
  126. </body>
  127. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement