function runEnter() {
// Prevent the page from refreshing after pressing enter
    d3.event.preventDefault();
// Select HTML node and the input element
    let inputDate = d3.select("#datetime");
// Get the value of the input element
    let dateValue = inputDate.property("value");
// Console log data 
// console.log(dateValue);
// Use the form input to filter through data
    let filteredData = tableData.filter(sightings => sightings.datetime === dateValue);
// Console log 
// console.log(filteredData);
// Clear the previously displayed data
    let tbody = d3.select("tbody"); 
    tbody.html("");
// Populate the table by appending data
    filteredData.forEach((sightDate) => {
        console.log(sightDate);
        let newRow = tbody.append('tr');
        Object.entries(sightDate).forEach(([key, value]) => {
            let newCell = newRow.append('td');
            newCell.text(value);     
        });
    });  
}
// Filter data using event handlers from the form
Filter data using event handlers from the form
Filter data using event handlers from the form
function runEnter() {
    d3.event.preventDefault();
    let inputDate = d3.select("#datetime");
    let dateValue = inputDate.property("value");
    let filteredData = tableData.filter(sightings => sightings.datetime === dateValue);
    let tbody = d3.select("tbody"); 
    tbody.html("");
    filteredData.forEach((sightDate) => {
        console.log(sightDate);
        let newRow = tbody.append('tr');
        Object.entries(sightDate).forEach(([key, value]) => {
            let newCell = newRow.append('td');
            newCell.text(value);     
        });
    });  
}
function runEnter ( ) { d3 . event . preventDefault ( ) ; let inputDate = d3 . select ( "#datetime" ) ; let dateValue = inputDate . property ( "value" ) ; let filteredData = tableData . filter ( sightings => sightings . datetime === dateValue ) ; let tbody = d3 . select ( "tbody" ) ; tbody . html ( "" ) ; filteredData . forEach ( ( sightDate ) => { console . log ( sightDate ) ; let newRow = tbody . append ( 'tr' ) ; Object . entries ( sightDate ) . forEach ( ( [ key , value ] ) => { let newCell = newRow . append ( 'td' ) ; newCell . text ( value ) ; } ) ; } ) ; }
Filter data using event handlers from the form
Filter data using event handlers from the form
// Prevent the page from refreshing after pressing enter // Select HTML node and the input element // Get the value of the input element // Console log data  // console.log(dateValue); // Use the form input to filter through data // Console log  // console.log(filteredData); // Clear the previously displayed data // Populate the table by appending data