I am having trouble with my Javascript table and deleting specific rows based on my buttons that I have created. I am using some of logic that I have used in previous assignments to mark the cell with a color for deleting the row. I have no idea what the proper way to call the deleteRow function is with onclick. Here is the code that I have:

```
var collection = [ 

    {Header1:"1, 1" , Header2: "2, 1" , Header3:"3, 1", Header4: "4, 1"},
    {Header1:"1, 2" , Header2: "2, 2", Header3:"3, 2", Header4: "4, 2" },
    {Header1:"1, 3" , Header2: "2, 3" , Header3:"3, 3", Header4: "4, 3" }

];

function buildTable(array){

    var newTable = document.createElement("table");

    var properties = Object.keys(array[0]);
    console.log(properties);

    var firstRow = document.createElement("thead");

    var newRow;
    var newData;
    var newHeader;
    var button;
    var deleteButton;
    var editButton;

    for(var i = 0; i < properties.length; i++)
    {

        newHeader = document.createElement("th");
        newHeader.textContent = "Header" + " " + [i + 1];

        firstRow.appendChild(newHeader);
    }

    newTable.appendChild(firstRow);

    for(var j = 0; j < array.length; j++)
    {
        newRow = document.createElement("tr");
        for(var k = 0; k < properties.length; k++)
        {
            newData = document.createElement("td");
            var propName = properties[k];
            newData.textContent = array[j][propName];
            newRow.appendChild(newData);

        }

        deleteButton = document.createElement("BUTTON");        
        var deleteText = document.createTextNode("DELETE");
        editButton = document.createElement("BUTTON");
        var editText = document.createTextNode("EDIT");
        deleteButton.appendChild(deleteText);                                
        newRow.appendChild(deleteButton);
        editButton.appendChild(editText);                                
        newRow.appendChild(editButton);

        newTable.appendChild(newRow);

    }

return newTable; 
}

var newTable = document.body.appendChild(buildTable(collection));

function deleteRow(tableID, currentRow){

    try {
        var table = document.getElementById(tableID);
        var rowCount = table.rows.length;
        for (var i = 0; i < rowCount; i++) {
            var row = table.rows[i];

            if (row==currentRow.parentNode.parentNode) {
                if (rowCount <= 1) {
                    alert("Cannot delete all the rows.");
                    break;
                }
                table.deleteRow(i);
                rowCount--;
                i--;
            }
        }
    } catch (e) {
        alert(e);
    }

}

deleteButton.onclick = deleteRow(newTable, newRow);

```

When I click the delete button nothing happens. Any suggestion on how to properly call the deleteRow function with the onclick command?