JSFiddle - React, Tailwind, and code Playground

by mrienstra

HTML

<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css">
<input id="autocomplete">

CSS

body { margin: 1em; }

JavaScript

// Source: https://developer.mozilla.org/en-US/docs/HTML/Element
var html5Elements = {
    standard: ['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','command','data','datalist','dd','del','details','dfn','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','keygen','label','legend','li','link','map','mark','menu','meta','meter','nav','nobr','noscript','object','ol','optgroup','option','output','p','param','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','table','tbody','td','textarea','tfoot','th','thead','time','title','tr','track','u','ul','var','video','wbr'],
    nonStandard: ['bgsound','blink','marquee','spacer'],
    obsolete: ['acronym','big','frame','frameset','tt'],
    deprecated: ['applet','basefont','center','dir','font','isindex','listing','noframes','plaintext','strike']
};

// Not allowed within the body tag (todo: double-check this list)
html5Elements.outOfScopeElements = ['base', 'body', 'head', 'html', 'link', 'meta', 'title'];
$.each(html5Elements.outOfScopeElements, function(i,v){
    if (html5Elements.standard.indexOf(v) !== -1) {
        html5Elements.standard.splice(html5Elements.standard.indexOf(v), 1);
    }
});

// Foundation templates (todo: add the rest)
html5Elements.foundationTemplates = ['alert-box', 'alert-box-success'];

$( "#autocomplete" ).autocomplete({
    source: html5Elements.standard,
    delay: 75
});