Auto Complete Textbox in Jquery



HTML & Jquery code:


<html>
<head>
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
                <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
                <link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css" rel="stylesheet"/>

                <script>
                $(document).ready(function(){
                                var carName = new Array();
                                carName.push("Volvo");
                                carName.push("Saab");
                                carName.push("Mercedes");
                                carName.push("Audi");
                                $('#txtName').autocomplete({source :carName});
                });
                </script>
</head>

<body>
<input type="text" id="txtName"></input>
<select>
   <option value="volvo">Volvo</option>
   <option value="saab">Saab</option>
   <option value="mercedes">Mercedes</option>
   <option value="audi">Audi</option>
</select>

</body>

</html>

Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

A type named 'SP.Data. could not be resolved by the model error

Add content type to SharePoint List/Library using REST API