/*************** TO DO **********************/ 'use strict'; $(document).on('click', '.to-do-list .form-check-label .form-check-input', function () { $(this).parent('label').toggleClass('line-through'); }); $(document).on('click', '.todo-remove', function () { $(this).closest("li").remove(); return false; }); //todo add $(".tdl-new").on('keypress', function (e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { var v = $(this).val(); var s = v.replace(/ +?/g, ''); if (s == "") { return false; } else { $(".tdl-content ul").append("
  • clear
  • "); $(this).val(""); } } }); // for dynamically created a tags $(".tdl-content").on('click', "a", function () { var _li = $(this).parent().parent("li"); _li.addClass("remove").stop().delay(100).slideUp("fast", function () { _li.remove(); }); return false; });