New Feature: Playlist Center! Pick a topic and let our playlists guide the way—like a learning mixtape.

Start learning with our library of video tutorials taught by experts. Get started

HTML5 Projects: Advanced To-Do List
Illustration by

Setting up the HTML


From:

HTML5 Projects: Advanced To-Do List

with Joseph Lowery

Video: Setting up the HTML

Most of the action in the advanced to do list is on the JavaScript front, but we do have some essential HTML to put in place first. So, let's get to it. I have opened the index.htm file from the Chapter three 03 01 folder of the exercise files. Its important to note that for this advance to do list you need to preview your documents through a local or remote web server. I am using the local web server map, so my files are located in that apps htdocs folder.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
HTML5 Projects: Advanced To-Do List
45m 50s Intermediate Aug 26, 2013

Viewers: in countries Watching now:

The HTML5 Projects series combines HTML5, CSS3, and recent JavaScript API technologies to enhance your web projects with interactivity and multimedia. This installment shows how to create a basic to-do list widget with an editable field so users can enter their tasks and delete them as they are completed, and a more advanced version with all the bells and whistles, including a drag-and-drop interface that allows for quick and easy sorting. Author Joseph Lowery covers HTML5 technologies such as web databases, content editing in the browser, and CSS transitions and transforms.

Topics include:
  • Making content editable
  • Saving edits
  • Setting up the core files for your app
  • Removing list items
  • Enabling drag-and-drop sorting
Subjects:
Design Web User Experience Web Design Projects
Software:
HTML JavaScript CSS
Author:
Joseph Lowery

Setting up the HTML

Most of the action in the advanced to do list is on the JavaScript front, but we do have some essential HTML to put in place first. So, let's get to it. I have opened the index.htm file from the Chapter three 03 01 folder of the exercise files. Its important to note that for this advance to do list you need to preview your documents through a local or remote web server. I am using the local web server map, so my files are located in that apps htdocs folder.

The code we want to work with is in a div little bit later down the page so let me scroll down a bit and here you see it on lines 41 and 42. It's a div with the id of container, I'm going to make a little space in the middle there with a little indentation and then add in my code. First, I'll need to put in the form that will hold the input field so that the user can type in his or her list item. We'll enter a simple name, form1. Give it a method of post. And we'll leave the action empty. So let's put in our input field first, with a type of text. We're going to give this a name, toDoItem.

And we'll use that same thing for the ID. And I'm going to take advantage of one of the more recent HTML5 properties that's become quite useful and prevalent in browser support, and that's auto focus. Alright, we have our input tag. And, of course, we're also going to need a submit button to add that entry, whatever it is, to the list. So another input tag. This has a type of button. The name is addToDo. And as before, we'll do id, the same as the name, addToDo.

And the value, the label, if you will, that'll appear in the button, Add List Item. And then we'll close off the tag. Our form has already been closed for us. So next we need to build up our list. There's not much building to do here as all the list items will be added dynamically via java script. All we need to do is add a URL tag with an ID. And a couple of classes to structure our unordered list. So UL will give an ID of the list and I need to put in two classes here sortable and list we'll be using those both for CSS purposes and Java Script purposes, I close the tag and (UNKNOWN) closes off my tag pair, I will just give it a little extra helping hand there showing that, that's were our additional list items will appear.

Now, finally, after the ul tag closes off, I'll add a paragraph tag to hold my clear all link. So we'll put in a paragraph with an id of doClearAll, close the opening paragraph tag and then we'll add in a link with an id equal to clearAll and the href is just going to be javascript:void(); because we're just getting that link. Then after the quote we'll close off our tag and put in the text Clear All. And that's all the HTML she wrote, javascript will really be doing the heavy lifting for this app and now we're ready to start on it in the next lesson.

There are currently no FAQs about HTML5 Projects: Advanced To-Do List.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed HTML5 Projects: Advanced To-Do List.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.