<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css">
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css">
<div id="tags-wrapper">
<p>Tags</p>
<input type="text" id="tags">
</div>
<script>
var data = [{
value: "Cloth | V(6811GC)B12",
description: "Pano para de una mesa de billar snooker de 12 pies:",
type: "",
qty: "1",
price: "49.15",
tax: "IVA",
rate: "18"},
{
value: "Cloth | V 6811C B6",
description: "Pano de pool para una cama de billar tomano 6:",
type: "",
qty: "1",
price: "59.83",
tax: "IVA",
rate: "18"},
{
value: "Cloth | V(6811GC)12C",
description: "Pano para la cama en una mesa de 12 pies':",
type: "",
qty: "1",
price: "256.26",
tax: "IVA",
rate: "18"}];
</script>
CSS
div{margin:20px 10px;}
JavaScript
$(function() {
var newData = $.map(data, function(item, idx) {
var label = item.value;
var value = $.trim(label.split('|').pop());
return $.extend({}, item, {
label: label,
value: value
});
});
$("#tags").autocomplete({
source: newData
});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.