{"size": 643, "ext": "js", "max_stars_repo_path": "To-do list with jQuery/behaviour.js", "max_stars_repo_name": "Sushantdbg/miniProjects", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "To-do list with jQuery/behaviour.js", "max_issues_repo_name": "Sushantdbg/miniProjects", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "To-do list with jQuery/behaviour.js", "max_forks_repo_name": "Sushantdbg/miniProjects", "max_forks_repo_forks_event_min_datetime": "2022-02-23T16:15:43.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-25T10:58:40.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 23.8148148148, "max_line_length": 56, "alphanum_fraction": 0.4525660964}
$(function() {
  $("#add").on("click", function() {
    var val = $("input").val();
    if (val !== '') {
      var elem = $("<li></li>").text(val);
      $(elem).append("<button class='rem'>❌</button>");
      $("#mylist").append(elem);
      $("input").val("");
    } else {
      alert('Please enter something');
    }
  });

  $("#mylist").on('click', 'button.rem', function() {
    $(this).parent().remove();
  });

  $("#clearAll").click(function() {
    let listItems = $('#mylist li');
    if (listItems.length) {
      listItems.remove();
    } else {
      alert('No items in To-Do-List.');
    }
  });
});
