Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#custom-templates .empty-message {
padding: 5px 10px;
text-align: center;
<div id="custom-templates">
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture">
$('#custom-templates .typeahead').typeahead(null, {
name: 'best-pictures',
display: 'value',
source: bestPictures,
templates: {
empty: [
'<div class="empty-message">',
'unable to find any Best Picture winners that match the current query',
suggestion: function(resultRow) { return '<div><strong>' + resultRow.value + '</strong> – ' + resultRow.year + '</div>'; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.