Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var wunschliste= [];
- var input;
- var arraypointer;
- //Baut die ganze Liste erneut auf - refreshed diese sozusagen.
- var refreshwunschliste = "";
- for (var i = 0; i < wunschliste.length; i++) {
- arraypointer = i;
- html += "<tr><td>" + (i + 1) + ". " + wunschliste[i] + "</td></tr>";
- html += "<tr><td><input name='altenwunschlöschen'id='" + arraypointer + "'type='button'value='X'onclick='wunschLöschen(wunschinput)'></td></tr>"
- }
- function wunschHinzufügen(input) {
- inputcounter = wunschliste.length + 1;
- wunschliste.push(input.value);
- console.log(wunschliste);
- document.getElementById("wunschliste").innerHTML += refreshwunschliste;
- }
- function wunschLöschen(wunschinput) {
- wunschliste.splice(wunschinput.id, 1); //Entfernt 1 Element an der Index-Stelle des Arrays wunschliste - wohin der arraypointer (die id des jeweiligen Buttons) hinverweist.
- document.getElementById("wunschliste").innerHTML += refreshwunschliste;
- }
- window.onload = textloopen();
- function textloopen() {
- var gelooptertext = ["I wish Jan a merry Christmas!", "Santa be partying Christmas!", "Lasse is nowhere to be seen on New Year!"];
- for(var loop=0;loop<3;loop++) {
- console.log(document);
- console.log(document.getElementById("looptext"))
- document.getElementById("looptext").innerHTML += gelooptertext[loop];
- console.log(document.getElementById("looptext"));
- setTimeout(() => {}, 3000);
- }
- loop=0;
- //if(1 > 0) {
- //document.getElementById("looptext").innerHTML += gelooptertext1;
- //console.log(document.getElementById("looptext");
- //setTimeout((){}, 3000);
- //document.getElementById("looptext").innerHTML += gelooptertext2;
- //console.log(document.getElementById("looptext");
- //setTimeout((){}, 3000);
- //document.getElementById("looptext").innerHTML += gelooptertext3;
- //console.log(document.getElementById("looptext");
- //setTimeout((){}, 3000);
- //loop = 0;
- //} else {
- // loop = 1;
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment