I am working on an Ajax Live Search. My goal: When you click on one of the suggested results, the result shall be inserted into the search field. For example, when you enter "ros" into the input field and you want to look for roses and roses is a result suggested to you, then I want roses to show up in the search field on click.

```
<!-- Lets assume that up to this point the user has typed "ros" 
into the following field -->
<input id="search" type="text">

<!-- ... then roses is a suggested result, with "ros" being highlighted -->
<ul id="results">
  <li class="result">
    <a> 
      <b class="highlight">ros</b>"es"</p>
    </a>
</ul>

```

Here is the jQuery code that I have come up with so far, but it won't work:

```
$('#results a').click(function() {
    var selection = $(this).html();
    $('#search').val(selection);
});

```

Anyone has detected the error?