<li onClick="fill('#cpu', '2 x intel xeon e5462');">2 x intel xeon e5462</li>
<li onClick="fill('#cpu', '2 x intel qx9775');">2 x intel qx9775</li>
function fill(myid, value) {
$(myid).val(value);
$(myid + '-suggest').hide('slow');
}
can't help you but it does the same thing in google chrome, closes the list box.
Not sure about your original problem but you shouldn't be using onclick with jQuery. Instead, do something like:
Code:$(document).ready(function() { // Stuff… $('#cpu-list li').click(function() { fill('#cpu', $(this).text()); }); // More stuff… }); function fill(id, value) { $(id).val(value); $(id + '-suggest').hide('slow'); }
Code:<ul id="cpu-list"> <li>2 x intel xeon e5462</li> <li>2 x intel qx9775</li> </ul>
That way you don't end up polluting your markup with JavaScript.