function displaySearchResults (query, results) {

    // We're using data-attributes to govern CSS properties of the search form/results panel
    _root.setAttribute('data-displayresults','true');
    _root.removeAttribute('data-searchinit');
    _results.removeAttribute('aria-hidden');
    _results.removeAttribute('hidden');

    // Display number of results found above the results list
    _results
      .querySelector('div>h2')
        .textContent = results.length +
          (results.length === 1 ? ' result' : ' results') +
            ' found for "' + query + '"';

    if (results.length < 1) { return; }
    _results.querySelector('div').insertAdjacentHTML('beforeend',
      // The fun part:
      generateMarkup(results)
    );
  }
// Reveal search results panel and populate with data
Reveal search results panel and populate with data
Reveal search results panel and populate with data
function displaySearchResults (query, results) {
    _root.setAttribute('data-displayresults','true');
    _root.removeAttribute('data-searchinit');
    _results.removeAttribute('aria-hidden');
    _results.removeAttribute('hidden');
    _results
      .querySelector('div>h2')
        .textContent = results.length +
          (results.length === 1 ? ' result' : ' results') +
            ' found for "' + query + '"';
    if (results.length < 1) { return; }
    _results.querySelector('div').insertAdjacentHTML('beforeend',
      generateMarkup(results)
    );
  }
function displaySearchResults ( query , results ) { _root . setAttribute ( 'data-displayresults' , 'true' ) ; _root . removeAttribute ( 'data-searchinit' ) ; _results . removeAttribute ( 'aria-hidden' ) ; _results . removeAttribute ( 'hidden' ) ; _results . querySelector ( 'div>h2' ) . textContent = results . length + ( results . length === 1 ? ' result' : ' results' ) + ' found for "' + query + '"' ; if ( results . length < 1 ) { return ; } _results . querySelector ( 'div' ) . insertAdjacentHTML ( 'beforeend' , generateMarkup ( results ) ) ; }
Reveal search results panel and populate with data
Reveal search results panel and populate with data
// We're using data-attributes to govern CSS properties of the search form/results panel // Display number of results found above the results list // The fun part: