I am using Autocomplete Jquery from the following URL: http://jqueryui.com/demos/autocomplete/
I am making my project in MVC 3.0 (Raz开发者_如何学Cor)
In this I am displaying list of names from the database and its running fine.
Now I want to show this whole list in the div according to my project requirement.
Please help how can I display the Autocomplete data in the div.
Straight from the jQuery UI documentation (remote example):
$(function() {
// This function sets the results inside a div with id = 'log'
function log( message ) {
$( "<div/>" ).text( message ).prependTo( "#log" );
$( "#log" ).attr( "scrollTop", 0 );
}
$( "#birds" ).autocomplete({
source: "search.php",
minLength: 2,
select: function( event, ui ) {
log( ui.item ? "Selected: " + ui.item.value + " aka " + ui.item.id :
"Nothing selected, input was " + this.value );
}
});
});
<div id="log"></div>
精彩评论