Steps 3 and 4: Toggling and Removing of Glyphicon Star


#1

Hi Everyone,

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

I've got difficulties toggling the glyphicon star. Below is my jQuery:

var main = function() {
  $('form').submit(function() {
    var text = $("#todo").val();  
    var html = template(text);
    $(".list").append(html);
    $("#todo").val("");
    
 $(document).on("click", '.glyphicon-star', function() {
		$(this).toggleClass("active");
	});
    
  $(document).on( 
    	"click", ".glyphicon-remove", function (click) {
   		 $(this).removeClass("active");
  });
    
    return false;  
  });

Please advise as to why the glyphicon does not respond to any clicking.

Thank you very much in advance!


#2

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