level-1/static/js/app.js
// Create function for when the button is selected
Create function for when the button is selected
Create function for when the button is selected
function buttonClick() {
  var inputElement = d3.select("#datetime");
  var inputValue = inputElement.property("value");
  let filteredData = tableData;
  if (inputValue) {
    filteredData = tableData.filter(
      (sightings) => sightings.datetime === inputValue
    );
  }
  createTable(filteredData);
}
function buttonClick ( ) { var inputElement = d3 . select ( "#datetime" ) ; var inputValue = inputElement . property ( "value" ) ; let filteredData = tableData ; if ( inputValue ) { filteredData = tableData . filter ( ( sightings ) => sightings . datetime === inputValue ) ; } createTable ( filteredData ) ; }
Create function for when the button is selected
Create function for when the button is selected
// Select the input element and get the raw HTML node // Get the value property of the input element // Check the date that is input and the table data //   console.log(inputValue); //   console.log(tableData); // Grab the user input to filter the data // Check to see if the data filtered correctly //   console.log(filteredData); // Build the filtered table