(matches)
| 24 | }; |
| 25 | |
| 26 | const outputHtml = (matches) => { |
| 27 | if (matches.length > 0) { |
| 28 | const html = matches |
| 29 | .map( |
| 30 | (match) => ` |
| 31 | <div class="card card-body border-light mb-2"> |
| 32 | <h4>${match.City} (<span class="text-success">${match.District}</span>)</h4> |
| 33 | <h5><span class="text-info"> |
| 34 | ${match.State}</span></h5> |
| 35 | </div> |
| 36 | ` |
| 37 | ) |
| 38 | .join(""); |
| 39 | |
| 40 | matchList.innerHTML = html; |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | search.addEventListener("input", () => searchStates(search.value)); |