
const btnLoeschenKey = document.getElementById('delete_key');
const btnAllesLoeschen = document.getElementById('delete_all');

auslesen();


function auslesen() {

    var count = window.localStorage.length;
    for (let i=0; i<=count; i++) {
        var keyname = window.localStorage.key(i);
        document.getElementById('elem').value = window.localStorage.getItem("Haus");
        
    }
}


function loeschen() {
    var key = document.getElementById('key').value;
	window.localStorage.removeItem(key);
}

function allesLoeschen() {
	window.localStorage.clear();
}


btnLoeschenKey.addEventListener('click',  e => {
    loeschen()});

btnAllesLoeschen.addEventListener('click',  e => {
    allesLoeschen()});

