JavaScript list saving question
<p>I have this fiddle: <a href="http://jsfiddle.net/y8Uju/5/" rel="nofollow">http://jsfiddle.net/y8Uju/5/</a></p>

<p>I am trying to save the numbers, because, when I submit, the list of numbers gets erased. I am a little new to JavaScript so am not quite familiar to what is available. In PHP I would use sessions to save the list, but what can I do in JavaScript to do this?</p>

<p>Here is the JavaScript code:</p>

<pre><code>function bindName() {
    var inputNames = document.getElementById("names").getElementsByTagName("input");
    for (i = 0; i &lt; inputNames.length; i++) {
        inputNames[i].onkeydown = function() {
            if (this.value == "") {
                setTimeout(deletename(this), 1000);
            }
        }
    }
}

document.getElementById("addName").onclick = function() {
    var num1 = document.getElementById("name");
    var myRegEx = /^[0-9]{10}$/;
    var itemsToTest = num1.value;

    if (myRegEx.test(itemsToTest)) {
        var form1 = document.getElementById("names");

        var nameOfnames = form1.getElementsByClassName("inputNames").length;

        var newGuy1 = document.createElement("input");

        newGuy1.setAttribute("class", "inputNames");
        newGuy1.setAttribute("id", nameOfnames);
        newGuy1.setAttribute("type", "text");
        newGuy1.setAttribute("value", num1.value);

        form1.appendChild(newGuy1);
        num1.value = "";
        bindName();
    }
    else {
        alert('error');
    }
};

function deletename(name) {
    if (name.value == "") {
        document.getElementById("names").removeChild(name);
    }
}
</code></pre>
