Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <form name="abc">
- <input type="text" name="imie"/>
- <input type="text" name="nazwisko"/>
- <input type="text" name="wiek"/>
- <input type="date" name="urodziny" min="1890-01-01" max="2019-01-01" />
- <input type="button" value="Pisz" onclick="pisz()">
- </form>
- <script>
- function klasa(imie,nazwisko,wiek,data)
- {
- this.imie=imie;
- this.nazwisko=nazwisko;
- this.wiek=wiek;
- this.dataur=data
- this.spr=function()
- {
- if (this.wiek>18)
- return "pełnoletni";
- else return "niepełnoletni";
- }
- this.lata=function()
- {
- var r=new Date();
- var x=r.getFullYear();
- var y="";
- for(j=0;j<4;j++)
- y+=this.dataur.charAt(j)
- return x-y;
- }
- this.pokaz=function()
- {
- return this.imie+" "+this.nazwisko+" "+this.wiek+" "+this.spr()+" "+this.lata();
- }
- }
- function pisz()
- {
- i=document.abc.imie.value
- n=document.abc.nazwisko.value
- w=document.abc.wiek.value
- d=document.abc.urodziny.value
- a=new klasa(i,n,w,d)
- document.getElementById("id").innerHTML=a.pokaz()
- }
- </script>
- <div id="id"/>
- </body>
- </html>
- /////////////////////////
- <html>
- <head>
- </head>
- <body>
- <form name="abc">
- <input type="tekst" name="tekst"/>
- <input type="color" name="kolor"/>
- <input type="color" name="fkolor"/>
- <input type="range" name="rozmiar" value="16" min="5" max="30" step="1">
- <input type="button" value="Pisz" onclick="pisz()">
- </form>
- <script>
- function font(tekst,kolor,fkolor,rozmiar,typ)
- {
- this.tekst=tekst
- this.kolor=kolor;
- this.fkolor=fkolor;
- this.rozmiar=rozmiar;
- this.typ=typ;
- this.zmien=function()
- {
- return "<span style='
- }
- }
- function pisz()
- {
- t=document.abc.tekst.value
- i=document.abc.kolor.value
- l=document.abc.fkolor.value
- n=document.abc.rozmiar.value
- w=document.abc.typ.value
- a=new font(t,i,l,n,w)
- a.zmien()
- }
- </script>
- <div id="id">JDJDJDJDJJDDJJDJDJDJ</div>
- </body>
- </html>
- ///////////////////
- <html>
- <head>
- </head>
- <body>
- <form name="form">
- <input type="text" name="tekst">
- <select name="czcionka">
- <option value="Calibri">Calibri</option>
- <option value="Arial">Arial</option>
- <option value="Times New Roman">Times New Roman</option>
- <option value="Arial Black">Arial Black</option>
- </select>
- <input type="range" name="suwak" value="16" min="5" max="30" step="1">
- <input type="color" name="kolor">
- <input type="button" onclick="wypisz()" value="Wypisz">
- </form>
- <script>
- function wypisz() {
- var tekstowo=document.form.tekst.value;
- var czcioneczka=document.form.czcionka.value;
- var suwaczek=document.form.suwak.value;
- var kolorek=document.form.kolor.value;
- document.getElementById("abc").innerHTML="<span style='font-family:"+czcioneczka+"';>"+tekstowo.fontcolor(kolorek).fontsize(suwaczek)+"</span>";
- }
- </script>
- <div id="abc"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement