Task 2.b passing text as input to template()


#1


project link: https://www.codecademy.com/en/courses/jquery-ext/projects/jquery-prj_listeasy?link_content_target=interstitial_project


I can not figure out how to add new list items. I think the problem lies with my var html = $('text').template(); but I'm not sure.


var template = function(text) {
  return '<p><input type="checkbox"><i class="glyphicon glyphicon-star"></i><span>' + text + '</span><i class="glyphicon glyphicon-remove"></i></p>';
};

var main = function() {
  $('form').submit(function() {
    var text = $('#todo').val();
    var html = $('text').template();
    $('html').append('.list');
    $('#todo').clear();
      
    
    
    return false;  
  });
  
  
};

$(document).ready(main);


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.