Building a todo list in javascript
<p>I'm rather new to javascript and working through javascript &amp; jquery book. To test myself I am trying to build a todo list javascript. With the help of the book I've been able to build of the remove from list function. </p>

<p>However, I can't seem to get the addToList function to work and I don't know why. Insight is much appreciated.</p>

<p>The javascript code:</p>

<pre><code>var item, list, feedback;
item = document.getElementById("item");
list = document.getElementById("list");
feedback = document.getElementById("feedback");

function addToList() { 

    console.log("I am in");
    var newElement = document.createElement("li");
    console.log(item.value);
    newItem = item.value
    newElement.innerHTML = newItem;
    list.appendChild('&lt;a&gt;newElement&lt;/a&gt;');
    // el.innerHTML = item.value;
    feedback.innerHTML = "Item added.";
    console.log("working");
}

function removeFromList(e) {
    var target, elParent, elGrandparent;
    target = e.target;
    elParent = target.parentNode;
    elGrandparent = target.parentNode.parentNode;
    elGrandparent.removeChild(elParent);
    e.preventDefault();
    feedback.innerHTML = "Item removed.";
}

list.addEventListener("click", function (e) {
    removeFromList(e);
}, false);

var btn = document.getElementById("add");
btn.addEventListener("click", addToList, false);
</code></pre>

<p>My HTML looks like:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Todo List&lt;/title&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;input type="text" name="item"&gt;&lt;br /&gt;
        &lt;input type="button" name="add" value="Add" id="add"&gt;

        &lt;ul id="list"&gt;
            &lt;li&gt;&lt;a href="#"&gt;Go to the store.&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#"&gt;Visit family.&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;

        &lt;div id="feedback"&gt;&lt;/div&gt;


        &lt;script type="text/javascript" src="todo.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>