fuzzy1

/* http://stackoverflow.com/questions/23305000/javascript-fuzzy-search-that-makes-sense */

by guest271314

HTML

<form id="form">
    <input type="text" name="input" id="input" autofocus="true" form="form" placeholder="int" />
    <output name="output" form="form" for="input"></output>
</form>

JavaScript

(function (int) {
    $("input[id=input]")
        .on("input", {
        sort: int
    }, function (e) {
        $.each(e.data.sort, function (index, value) {
            if (value.indexOf($(e.target).val()) != -1 && value.charAt(0) === $(e.target).val().charAt(0) && $(e.target).val().length === 3) {
                $("output[for=input]").val(value)
            };
            return false
        });
        return false
    });
}(["international", "splint", "tinder"]))