Search

Trying to make it so when you click/press enter on an option, you press the button, get the value, and it alerts and says "You tried to search..." ...whatever the value was.

by db_dev

HTML

<h1 title="Hi! Feel free to search any programming language starting with 'A' or 'B'">Search</h1>

<input title="Search a programming language starting with 'A' or 'B'" id="input"><b> </b>

<button id="clickme" type="button" title="Search" onclick="search()" value="Search">Search</button>

CSS

body {
    background-color: #252525
}
h1 {
    color: #96f226;
    font-size: 36px;
    width: 108px;
}
#clickme {
    border-radius: 0px;
    background: #4a4a4a;
    color: #96f226;
    border: 1px solid #454545
}
#clickme:hover {
    background: #656565;
    cursor: pointer;
}
#clickme:active {
    box-shadow: 0 0 30px #96f226
}
#input {
    border-radius: 0px;
    background: #4a4a4a;
    color: #96f226;
    border: 1px solid #454545;
    height: 0 0 30px;
}
#input:hover {
    background: #656565
}
#input:active {
    box-shadow: 0 0 30px #96f226
}
#input:focus {
    box-shadow: 0 0 30px #96f226
}
.ui-tooltip {
    background: #4a4a4a;
    color: #96f226;
    border: 2px solid #454545;
    border-radius: 0px;
    box-shadow: 0 0 
}
.ui-autocomplete {
    background: #4a4a4a;
    border-radius: 0px;
}
.ui-autocomplete.source:hover {
    background: #454545;
}

.ui-menu .ui-menu-item a{
    background:red;
    height:10px;
font-size:8px;}

JavaScript

$(document).ready(function () {
    $(document).tooltip();
    var langs = [
        "A# .NET",
        "A#",
        "A-0 System",
        "A+",
        "A++",
        "ABAP",
        "ABC",
        "ABC ALGOL",
        "ABLE",
        "ABSET",
        "ABSYS",
        "Abundance",
        "ACC",
        "Accent",
        "Ace DASL",
        "ACT-III",
        "Action!",
        "ActionScript",
        "Ada",
        "Adenine",
        "Agda",
        "Agilent VEE",
        "Agora",
        "AIMMS",
        "Alef",
        "ALF",
        "ALGOL 58",
        "ALGOL 60",
        "ALGOL 68",
        "Alice",
        "Alma",
        "AmbientTalk",
        "Amiga E",
        "AMOS",
        "AMPL",
        "APL",
        "AppleScript",
        "Arc",
        "ARexx",
        "Argus",
        "AspectJ",
        "Assembly language",
        "ATS",
        "Ateji PX",
        'AutoHotkey',
        'Autocoder',
        'AutoIt',
        'AutoLISP / Visual LISP',
        'Averest',
        'AWK',
        'Axum',
        'B',
        'Babbage',
        'BAIL',
        'Bash',
        'BASIC',
        'bc',
        'BCPL',
        'BeanShell',
        'Batch',
        'Bertrand',
        'BETA',
        'Bigwig',
        'Bistro',
        'BitC',
        'BLISS',
        'Blue',
        'Bon',
        'Boo',
        'Boomerang',
        'Bourne shell',
        'BREW',
        'BPEL',
        'BUGSYS',
        'BuildProfessional'];
    $('#input').autocomplete({
        source: langs
    });
    window.search = function () {
        var a = document.getElementById('input').value;
        confirm("You tried to search " + a + "!");
    };
});