function doesn't fire on click

function doesn't fire on click

This function is not firing or giving me an error when I click the anchor.  There is a css button for the clear-completed id but the function should fire on the click in the anchor anyway.
I want to collect all the ids on the table rows then send an AJAX.

$("a #clear-completed").click(function(){
        console.log("hello");
      $('#tbody tr').each(function(){   
      if ($('table input:checkbox').is(':checked')) {
        var ids =new Array;
        ids += $(this).parent().find(data('itemid',item.id));
        console.log(JSON.stringify(ids));;

   }
   
});
});

<footer>
   <a id="clear-completed">Clear completed</a>
   <div id="todo-count"></div>
</footer>