{"size": 950, "ext": "js", "max_stars_repo_path": "03_Programming_Advanced/01_JS_Core/03_JavaScript_Advanced/03_DOM_Manipulations_Lab/03_Delete_From_Table/app.js", "max_stars_repo_name": "Knightwalker/Knowledgebase", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "03_Programming_Advanced/01_JS_Core/03_JavaScript_Advanced/03_DOM_Manipulations_Lab/03_Delete_From_Table/app.js", "max_issues_repo_name": "Knightwalker/Knowledgebase", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "03_Programming_Advanced/01_JS_Core/03_JavaScript_Advanced/03_DOM_Manipulations_Lab/03_Delete_From_Table/app.js", "max_forks_repo_name": "Knightwalker/Knowledgebase", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.1851851852, "max_line_length": 133, "alphanum_fraction": 0.6231578947}
function deleteByEmail() {
    let inputValue = document.querySelector("body > label > input[type=text]").value; 
    document.querySelector("body > label > input[type=text]").value = ""; 
    let resultElement = document.getElementById("result");
    
    let rows = document.querySelectorAll("#customers > tbody > tr");
    let deleteChecker = false;
    for (let i = 0; i < rows.length; i++) {
        let currentRow = rows[i];
        let currentElement = currentRow.getElementsByTagName("td"); // returns HTMLCollection from the 3 elements in the current row;
        
        if (currentElement[1].textContent == inputValue) {
            console.log(currentRow.parentElement.removeChild(currentRow));
            deleteChecker == true;
        }
        
    }

    if (deleteChecker) {
        resultElement.textContent = "Deleted."; 
    } else {
        resultElement.textContent = "Not found."; 
    }
   
    //console.log(inputValue);

}