JSFiddle - React, Tailwind, and code Playground

by doug65536

HTML

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

JavaScript

function getAutocomplete(request, response) {
    var langs = [
        "Javascript",
        "Java",
        "Perl",
        "C++",
        "C#",
        "SQL",
        "PHP",
        "Lua",
        "Assembly",
        "AngelScript",
        "BASIC",
        "Pascal",
        "Lisp",
        "BASH",
        "Powershell",
        "Logo",
        "MaxScript",
        "Python",
        "Postscript",
        "VB6"
    ];
    
    var result = [];
    for (var i = 0; i < langs.length; ++i) {
        if (langs[i].toLowerCase().indexOf(request.term.toLowerCase()) >= 0) {
            result.push(langs[i] + "!!!");
        }
    }
    
    response(result);
}

$('input').autocomplete({
    minLength: 3,
    delay: 2000,
    source: getAutocomplete
});