Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Javascript example</title>
- <script>
- function risajzuj_me()
- {
- //getElementById - Uzima HTML element po ID-u i menja mu osobine
- document.getElementById('paragraf').style.height = 500; //menja duzinu
- document.getElementById('paragraf').style.width = 500; //menja sirinu
- }
- function risajzuj_me1()
- {
- document.getElementById('paragraf').style.height = 250;
- document.getElementById('paragraf').style.width = 250;
- }
- function prikazi_me()
- {
- document.getElementById('paragraf').style.display = "block";
- }
- function prikazi_me1()
- {
- document.getElementById('paragraf').style.display = "none";
- //alert("Nestao sam"); //Koristi se za brzo debugiranje i za pojedine informacije korisniku.
- }
- function zacrveni_me(color)
- {
- document.getElementById('paragraf').style.backgroundColor = color;
- }
- </script>
- </head>
- <body>
- <p id="paragraf" style="width:200px; height:200px; background-color:green;">Ja sam ja, Jeremija</p>
- <input type="button" onclick="risajzuj_me();" name="button" id="button" value="Povecaj me" />
- <input type="button" onclick="risajzuj_me1();" name="button" id="button" value="Smanji me" />
- <input type="button" onclick="prikazi_me();" name="button" id="button" value="Prikazi me" />
- <input type="button" onclick="prikazi_me1();" name="button" id="button" value="Sakrij me" />
- <input type="button" onclick="zacrveni_me('red');" name="button" id="button" value="Zacrveni me" />
- <input type="button" onclick="zacrveni_me('green');" name="button" id="button" value="Zazeleni me" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement