jsFiddle Demo
It is not possible to make these suggestions appear on the input as a drop-down menu. However, you can psuedo-recreate the functionality you are looking for using jQuery .on('input API next to the div that shows the sentences.
$('#grade').on('input focus', function(){ // show the suggestions below the text input var inp = $("#grade").val().toLowerCase(); var sgst = []; var opts = $("#gradeSuggestions")[0].options; for( var opt in opts ){ if( !opts[opt].hasOwnProperty("nodeName") )continue; if( opts[opt].value.toLowerCase().indexOf(inp) > -1 ) sgst.push(opts[opt].value); } var s = $("#suggestions"); s.html(''); for( var sg in sgst ){ var sug = $('<div>'+sgst[sg]+'</div>'); (function(val){ sug.click(function(){ $("#grade").val(val); $("#grade").focus(); }); })(sgst[sg]); s.append(sug); } });
source share