function runEnter() {

    //Prevent the page from refreshing
    d3.event.preventDefault();

    //Clear out the table
    tbody.html("");

    //Select the input element and get the raw HTML node
    var inputElement = d3.select("#datetime");
    //Get the value property of the input element
    var inputValue = inputElement.property("value");
    console.log(inputValue);

    //Filter the data
    var filteredData = tableData.filter(sighting => sighting.datetime === inputValue);
    console.log(filteredData);

    //Add the filtered data only to the table
    filteredData.forEach(function(selections) {
        console.log(selections);
        // Append to the table like above
        var row = tbody.append("tr");
        Object.entries(selections).forEach(function([key, value]) {
            console.log(key, value);
            var cell = row.append("td");
            cell.text(value);
        });
    });
}
//Complete the event handler function for the form
Complete the event handler function for the form
Complete the event handler function for the form
function runEnter() {
    d3.event.preventDefault();
    tbody.html("");
    var inputElement = d3.select("#datetime");
    var inputValue = inputElement.property("value");
    console.log(inputValue);
    var filteredData = tableData.filter(sighting => sighting.datetime === inputValue);
    console.log(filteredData);
    filteredData.forEach(function(selections) {
        console.log(selections);
        var row = tbody.append("tr");
        Object.entries(selections).forEach(function([key, value]) {
            console.log(key, value);
            var cell = row.append("td");
            cell.text(value);
        });
    });
}
function runEnter ( ) { d3 . event . preventDefault ( ) ; tbody . html ( "" ) ; var inputElement = d3 . select ( "#datetime" ) ; var inputValue = inputElement . property ( "value" ) ; console . log ( inputValue ) ; var filteredData = tableData . filter ( sighting => sighting . datetime === inputValue ) ; console . log ( filteredData ) ; filteredData . forEach ( function ( selections ) { console . log ( selections ) ; var row = tbody . append ( "tr" ) ; Object . entries ( selections ) . forEach ( function ( [ key , value ] ) { console . log ( key , value ) ; var cell = row . append ( "td" ) ; cell . text ( value ) ; } ) ; } ) ; }
Complete the event handler function for the form
Complete the event handler function for the form
//Prevent the page from refreshing //Clear out the table //Select the input element and get the raw HTML node //Get the value property of the input element //Filter the data //Add the filtered data only to the table // Append to the table like above