MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / outputHtml

Function outputHtml

assets/js/StateSearch.js:26–42  ·  view source on GitHub ↗
(matches)

Source from the content-addressed store, hash-verified

24};
25
26const 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
44search.addEventListener("input", () => searchStates(search.value));

Callers 1

searchStatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected