
var counter = 0;

function onClick() {
    var element = document.getElementById("element");
    var menge = document.getElementById("menge");
    console.log(element.value);

    add(element.value, menge.value);

}

function add(input, menge) {
    counter++;
    var liste = document.getElementById("liste");

    var checkbox = document.createElement("input");
    checkbox.setAttribute("type", "checkbox");
    checkbox.setAttribute("id", "cb" + counter);
    checkbox.setAttribute("class", "checkmark");

    var label = document.createElement("label");
    label.innerHTML = input + "  " + menge;
    label.setAttribute("for", "cb" + counter);

    
    liste.appendChild(checkbox);
    liste.appendChild(label);
    liste.appendChild(document.createElement("br"));
}