jQuery - Code looks right but won't work
<p>Still learning this language on the side of my normal career and when getting the chance I tty to put together simple examples. This one is a To Do List in which a user enters a chore and clicks the button submitting the entry to be displayed below. However the below code, as correct as it looks (to me) it just won't do as intended...</p>

<h3>HTML (between Body tags)</h3>

<pre><code>&lt;div id="toDoContainer"&gt;
    &lt;h1&gt;To Do&lt;/h1&gt;
    &lt;p&gt;Here's your very own to do list, complete with added jQuery&lt;/p&gt;
    &lt;form id="toDo"&gt;
        &lt;input type="text" name"toDoEntry" /&gt;
        &lt;button id="addButton"&gt;Add&lt;/button&gt;
    &lt;/form&gt;

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

    &lt;p&gt;Tick a box next to your entry show as complete&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<h3>jQUERY:</h3>

<pre><code>$(document).ready(function(){
    $('button').click(function() {
        var toDoItem = $('input[name=toDoEntry]').val();
        if(toDoItem.length === 0) {
            alert('You need to add an entry into the toDo list');
        } else {
            $('#toDoList').append(toDoItem);
        }
    });
});
</code></pre>

<p>Any ideas as to where I'm going wrong?</p>

<p>Simon</p>
