Filter options of select box using input box value
I would start by moving the search term into the function definition, to save having to look up the DOM element. So I would change in the HTML 

 &lt;input type="text" id="search" name="search" style="margin: 10px;width: 165px;" onkeyup="filter(this.value)"&gt;


And then have function be defined with keyword as a parameter.

function filter(keyword) {
  ...
}


The other main change I would make is to use string.prototype.startsWith rather than substring checking, this is more explicit about what is trying to be done, and saves having logic to handle the empty string.

Also, rather than an If statement and then setting style.display, the display is set with either 'list-item' or 'none' with the ternary operator.

This leaves the function as 

function filter(keyword) {
    var select = document.getElementById("select");
    for (var i = 0; i &lt; select.length; i++) {
        var txt = select.options[i].text;
        var include = txt.toLowerCase().startsWith(keyword.toLowerCase());
        select.options[i].style.display = include ? 'list-item':'none';
    }
}


A further improvement you might want to look at may include moving the select element selection outside of this function to improve re-use.