Ik heb een bestaand autocomplete script. Zodra de input matched met het resultaat wil ik dit in bold weergeven.
Bijvoorbeeld:

input = be
resultaat = Belasting , of Overbevolking

Kan iemand me de juiste weg op helpen?
Alvast bedankt.

PHP Code:
function autoComplete(lastValue)
{
    
// get the field value
    
var part acSearchField.val();

    
// if it's empty clear the resuts box and return
    
if(part == ''){
        
clearAutoComplete();
        return;
    }

    
// if it's equal the value from the time of the call, allow
    
if(lastValue != part){
        return;
    }

    
// get remote data as JSON
    
$.getJSON(acURL part, function(json){

        
// get the total of results
        
var ansLength acListTotal json.length;

        
// if there are results populate the results div
        
if(ansLength 0){

            var 
newData '';

            
// create a div for each result
            
for(i=0ansLengthi++) {
                
newData += '<div class="unselected">' json[i] + '</div>';
            }

            
// update the results div
            
acResultsDiv.html(newData);
            
acResultsDiv.css("display","block");
            
            
// for all divs in results
            
var divs = $(acResultsId " > div");
        
            
// on mouse over clean previous selected and set a new one
            
divs.mouseover( function() {
                
divs.each(function(){ this.className "unselected"; });
                
this.className "selected";
            })
        
            
// on click copy the result text to the search field and hide
            
divs.click( function() {
                
acSearchField.val(this.childNodes[0].nodeValue);
                
clearAutoComplete();
            });

        } else {
            
clearAutoComplete();
        }
    });