I want to limit the amount of results in a search bar, because when I have a lot of search queries, it goes over the page. Is there a way to limit the amount of results or add a scroll bar once the queries reach a certain amount? For example, if there were 15 querys, could I shorten it to 5 and add a scroll bar?

```js
function myFunction() {
    var input, filter, ul, li, a, i, txtValue;
    input = document.getElementById("myInput");
    filter = input.value.toUpperCase();
    ul = document.getElementById("myUL");
    li = ul.getElementsByTagName("li");
    for (i = 0; i < li.length; i++) {
        a = li[i].getElementsByTagName("a")[0];
        txtValue = a.textContent || a.innerText;
        if (txtValue.toUpperCase().indexOf(filter) > -1 && filter != "") {//change here
            li[i].style.display = "";
            li[i].style.visibility = "visible";//change here
        } else {
            li[i].style.display = "none";
        }
    }
}
```

```css
#myInput {
  background-image: url('/css/searchicon.png');
  background-position: 10px 12px;
  background-repeat: no-repeat;
  width: 500px;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  border-radius: 4px;
}

#myUL {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 558px;
  position: absolute;
}

#myUL li a {
  border: 1px solid #ddd;
  margin-top: -1px;
  background-color: #f6f6f6;
  padding: 12px;
  text-decoration: none;
  font-size: 18px;
  color: black;
  display: block;
}

#myUL li a:hover:not(.header) {
  background-color: #eee;
}
```

```html
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." style="margin-left: 275px; font-family: 'Poppins', sans-serif; border-style: solid; border-width: 2px; border-color: #000000;" /><ul id="myUL" style="margin-left: 505px; visibility: hidden; font-family: 'Poppins', sans-serif; width: 562px;">
    <li><a href="#">Adele</a></li>
    <li><a href="#">Agnes</a></li>

    <li><a href="#">Billy</a></li>
    <li><a href="#">Bob</a></li>

    <li><a href="#">Calvin</a></li>
    <li><a href="#">Christina</a></li>
    <li><a href="#">Cindy</a></li>
    <li><a href="#">Daniel</a></li>
    <li><a href="#">Doug</a></li>
    <li><a href="#">Ralph</a></li>
    <li><a href="#">Randy</a></li>
    <li><a href="#">Selena</a></li>
    <li><a href="#">Trevor</a></li>
  </ul>
```