Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Uncaught SyntaxError: Unexpected Token {

says my problem is on the var createnewTaskElement line... I have no clue what it's trying to ask me to fix. Code seems fine to me.

//Net Task List Item
var createNewTaskElement = fucntion(taskString){
  //create list item
  var listItem = document.createElement("li");

      //input checkbox
  var checkBox = document.createElement("input");
      //label
  var label = document.createElement("label");
      //input {text}
  var editInput = document.createElement("input");
      //button.edit
  var editButton = document.createElement("button");
      //button.delete
  var deleteButton = document.createElement("button");
      //each elements needs modifying

      //each element needs appending
  listItem.appendChild(checkBox);
  listItem.appendChild(label);
  listItem.appendChild(editInput);
  listItem.appendChild(editButton);
  listItem.appendChild(deleteButton);

  return listItem;
}

Resolved! Couldn't spell the word 'function' correctly.

1 Answer

Hi, check the spelling of the word function on that line ;)