Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- var numer = 1;
- function myFunction() {
- if (numer == 1) {
- document.getElementById("demo" + numer).innerHTML = "Nowy akapit";
- document.getElementById("przycisk").firstChild.data = "INNY TEKST";
- }
- if (numer == 2) {
- document.getElementById("demo" + numer).innerHTML = "Jeszcze nowszy akapit";
- }
- if (numer == 3) {
- document.getElementById("demo" + numer).innerHTML = "Jeszcze jeszcze nowszy akapit!";
- }
- numer = numer + 1;
- }
- </script>
- </head>
- <body>
- <h2>Naglowek strony</h2>
- <p id="demo1"></p>
- <p id="demo2"></p>
- <p id="demo3"></p>
- <button onclick="window.location.href='http://www.google.pl'">Google</button>
- <button type="button" id="przycisk" onclick="myFunction()">Kliknij mnie</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement