JSFiddle - React, Tailwind, and code Playground
by adouga
HTML
<input type="text" name="url" />
<a href="http://mathiasbynens.be/demo/placeholder">watermark</a>
JavaScript
$(function() {
var arrLinks = [
{
key: 1,
url: "http://google.com",
label: 'google'},
{
key: 2,
url: "http://yahoo.com",
title: "Yahoo",
label: 'yahoo'},
{
key: 2,
url: "http://microsoft.com",
label: 'microsoft'}
];
$("input[name=url]").autocomplete({
source: arrLinks
}).data("autocomplete")._renderItem = function(ul, item) {
return $("<li>").data("item.autocomplete", item).append("<a>" + item.url + "</a>").appendTo(ul);
};
});