Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <body>
- <h1 id="tytul">TEN TEKST ZMIENI KOLOR</h1><hr>
- Podaj rozmiar tekstu w procentach
- <p>Przyciski zmieniaja kolor naglowka</p>
- <button id="red" onclick="kol('red');"> </button>
- <button id="blu" onclick="kol('blue');"> </button>
- <button id="gre" onclick="kol('green');"> </button>
- <script>
- function kol(kolor){
- var h1 = document.getElementById('tytul');
- h1.style.color = kolor;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement