{"size": 565, "ext": "js", "max_stars_repo_path": "JS-Advanced/Homeworks/05DOM-Manipulations-Lab/delete.js", "max_stars_repo_name": "kalintsenkov/SoftUni-Software-Engineering", "max_stars_repo_stars_event_min_datetime": "2020-12-30T08:58:37.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-15T12:52:14.000Z", "max_issues_repo_path": "JS-Advanced/Homeworks/05DOM-Manipulations-Lab/delete.js", "max_issues_repo_name": "zanovasevi/SoftUni-Software-Engineering", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "JS-Advanced/Homeworks/05DOM-Manipulations-Lab/delete.js", "max_forks_repo_name": "zanovasevi/SoftUni-Software-Engineering", "max_forks_repo_forks_event_min_datetime": "2019-06-08T08:50:21.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T21:20:21.000Z"}
{"max_stars_count": 8, "max_issues_count": null, "max_forks_count": 52, "avg_line_length": 31.3888888889, "max_line_length": 72, "alphanum_fraction": 0.6283185841}
function deleteByEmail() {
    const tbody = document.querySelector('tbody');
    const tdList = tbody.querySelectorAll('td');
    const result = document.querySelector('#result');
    const emailToDelete = document.querySelector("input[name='email']");

    let isDeleted = false;

    Array.from(tdList).forEach(td => {
        if (td.innerText === emailToDelete.value) {
            isDeleted = true;
            tbody.removeChild(td.parentElement);
        }
    });

    emailToDelete.value = '';
    result.innerText = !isDeleted ? 'Not found.' : 'Deleted';
}