title: Uncaught SyntaxError: Unexpected token function
body: <p>I keep getting the "unexpected token function" error when trying to run the following code. The error appears at the <code>if(highPriority(priority)) {</code> line. I appreciate any help, thanks.</p>
  
  <pre><code>$(function(){
    $("input[name=task]").focus();
  
    $("body").on("click","#add",function(){
  
      var task = $("input[name=task]").val();
      var priority = $(this).parent().children("input[name=priority]"); 
      var doneSpan = '&lt;span class="done"&gt;Done&lt;/span&gt;';  
  
      if(highPriorityChecked(priority)) {
  
      $("#todo").prepend("&lt;p class='row high-priority'&gt;" + task + doneSpan + "&lt;/p");
  
    } else {$("#todo").append("&lt;p class='row normal-priority'&gt;" + task + doneSpan + "&lt;/p");
      };
  
        resetForm();    
  
        doneList();  
  
  });
  
  }
  
  function highPriorityChecked(priority){
    return $("input[name=priority]").is(":checked");
  };
  
  function doneList(){ 
      $("#todo").on("click",".done",function(){
      var row = $(this).parent().detach();
      $("#done").prepend(row).remove(doneSpan);
      });
  }
  
  function buildRow(task, priority) {
    var row = '&lt;div class="row item ' + priority + '"&gt;' + task;
    var doneSpan = '&lt;span class="done"&gt;Done&lt;/span&gt;';
    return row + doneSpan + "&lt;/div&gt;";
  };
  
  function resetForm() {
    $("input[name=task]").val("").focus();
    $("input[name=priority]").removeAttr("checked");
   };
  </code></pre>