Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function zm1() {
- document.getElementById('div1').innerHTML = "Wywołałeś funkcję zdefiniowaną wewnątrz HTML";
- }
- </script>
- <script>
- function zm2() {
- document.getElementById('div2').innerHTML = "Zmiana na podstawie skryptu z zewnątrznego pliku";
- document.getElementById("div2").style.color = "red";
- }
- </script>
- </head>
- <body>
- <button onclick="zm1()">
- Nacisnij aby zmienić napis
- </button><br>
- <div id="div1">Jakiś napis początkowy</div>
- <br>
- <button onclick="zm2()">
- Nacisnij aby zmienić napis
- </button>
- <br>
- <div id="div2">Jakis napis początkowy</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement