Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html lang="PL">
- <head>
- <meta charset="UTF-8">
- <style>
- </style>
- <body bgColor="#fff">
- <form name="Dane">
- <legend>Wpisz tekst:</legend>
- <input type="text" name="tekst"/>
- <legend>Podaj wielkość czcionki:</legend>
- <input type="range" name="rozmiar" min="5" max="15" step="1" />
- <select name="typ">
- <legend>Wybierz czcionkę</legend>
- <option value="Calibri">Zwykły</option>
- <option value="Times New Roman">Gabriola</option>
- <option value="Arial">Freestyle Script</option>
- <option value="Segoe Print">Monotype Corsiva</option>
- </select>
- <legend>Podaj kolor czcionki:</legend>
- <input type="color" id="kolor">
- <legend>Podaj kolor tła:</legend>
- <input type="color" id="tlo">
- <input type="button" value="Ok" onClick="Dziala()"/>
- </form>
- <div id="wynik"></div>
- <script>
- function Dziala()
- {
- var tekst = document.Dane.tekst.value;
- var wielkosc = parseInt(document.Dane.rozmiar.value);
- var czcionka = document.Dane.typ.value;
- var kolorc = document.Dane.kolor.value;
- var kolort = document.Dane.tlo.value;
- var zmiana = new zamiana(tekst,wielkosc,czcionka,kolorc,kolort);
- zmiana.pokaz();
- }
- function zamiana(tekst1,wielkosc1,czcionka1,kolorc1,kolort1) {
- this.tekst1=tekst1;
- this.wielkosc1=wielkosc1;
- this.czcionka1=czcionka1;
- this.kolorc1=kolorc1;
- this.kolort1=kolort1;
- this.pokaz=function()
- {
- document.getElementById("wynik").innerHTML="<span style='font-family:"+czcionka1+";font-size:"+wielkosc1+"px"+";color:"+kolorc1+";background-color: "+kolort1+"'>"+tekst1+"</span>";
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement