Hallo, I want to make a todo list website for practicing, do you know why the JSON.stringify argument doesn't work in the script? The alert says: "eingabe = {}" no matter what I put in the input box. Thanks!
document.getElementById("addto").addEventListener("click", addtolist);
function addtolist() {
var eingabe = document.getElementById('meininput');
var liste = document.getElementById("liste").textContent;
alert("eingabe = " + typeof eingabe + " liste = "+ typeof liste + " eingabe = " + eingabe.value + " liste = "+ liste);
var eingabestring = JSON.stringify(eingabe);
alert("eingabe = " + typeof eingabestring + " liste = "+ typeof liste + " eingabe = " + eingabestring + " liste = "+ liste);
eingabestring.write('<br/>');
eingabestring.write(liste);
document.getElementById("liste").textContent = eingabe.nodeValue;
}
JSON.stringify doesn't work (for me :/)
in JavaScript
Posted
Hallo, I want to make a todo list website for practicing, do you know why the JSON.stringify argument doesn't work in the script? The alert says: "eingabe = {}" no matter what I put in the input box. Thanks!