Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:33:27+00:00 2026-06-15T10:33:27+00:00

Still learning this language on the side of my normal career and when getting

  • 0

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…

HTML (between Body tags)

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

    <div id="toDoList"></div>

    <p>Tick a box next to your entry show as complete</p>
</div>

jQUERY:

$(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);
        }
    });
});

Any ideas as to where I’m going wrong?

Simon

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:33:28+00:00Added an answer on June 15, 2026 at 10:33 am

    You have a simple HTML syntax error.

    Change:

     <input type="text" name"toDoEntry" />
    

    To:

     <input type="text" name="toDoEntry" />
    

    Also remove your <form> tag. This will navigate you away from the current instance of the page.

    For more information on HTML Forms, read this helpful blog post:

    http://webdesign.about.com/od/forms/ss/html-forms-tutorial.htm


    I would also recommend splitting your “to do list items” or else they will be concatenated to each other.

    For example, if you add “Task 1” and “Task 2”, this will become “Task 1Task2”. I recommend putting them in a <ul> list:

    $(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 {
                var $li = $("<li/>");
                $li.append(toDoItem);
                $('#toDoList').append($li);
            }
        });
    });​
    

    — SEE WORKING DEMO —

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry guys, didn't know how to word this one. Still learning jquery and have
I'm still learning Python as great simple programming language, the problem came with DataBase
Ok I am still learning this... I have Googled and done some research but
Still learning CSS so pardon if this is obvious - I am building a
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't
Still learning WPF....thanks for any help. Is there any way to Refactor this: <ListBox
Still learning JSP Web Applications here. I have been doing this for a while
So, I'm still new with the php coding, still learning, etc. So, if this
Hello everyone I'm currently implementing a simple programming language for learning experience but I'm
I´m still learning my way around MVC programming and have one question for you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.