initSearchEvents() {

    document.getElementById("search-form")
      .addEventListener("submit", (event) => {
        // Avoid reeloading the page on submit
        event.preventDefault();
        return this.context.onSearch();
      });

    document.getElementById("search-btn")
      .addEventListener("click", this.context.onSearch());

    document.getElementById("reset-search-btn")
      .addEventListener("click", this.context.onResetSearch());
  }
/**
   * Init events listener for the search (submit and clicks on buttons)
   */
Init events listener for the search (submit and clicks on buttons)
Init events listener for the search ( submit and clicks on buttons )
initSearchEvents() {
    document.getElementById("search-form")
      .addEventListener("submit", (event) => {
        event.preventDefault();
        return this.context.onSearch();
      });
    document.getElementById("search-btn")
      .addEventListener("click", this.context.onSearch());
    document.getElementById("reset-search-btn")
      .addEventListener("click", this.context.onResetSearch());
  }
initSearchEvents ( ) { document . getElementById ( "search-form" ) . addEventListener ( "submit" , ( event ) => { event . preventDefault ( ) ; return this . context . onSearch ( ) ; } ) ; document . getElementById ( "search-btn" ) . addEventListener ( "click" , this . context . onSearch ( ) ) ; document . getElementById ( "reset-search-btn" ) . addEventListener ( "click" , this . context . onResetSearch ( ) ) ; }
Init events listener for the search (submit and clicks on buttons)
Init events listener for the search ( submit and clicks on buttons )
// Avoid reeloading the page on submit