jQuery - Widget AutoComplete


The Widget AutoComplete function can be used with widgets in JqueryUI.The Autocomplete widgets provides suggestions while you type into the field.For suppose give Ja as an input, it will provides an output as Java or JavaScript.


Here is the simple syntax to use Autocomplete −

$( "#tags" ).autocomplete({
   source: availableTags


Following is a simple example showing the usage of Autocomplete −

<!doctype html>
<html lang = "en">
      <meta charset = "utf-8">
      <title>jQuery UI Autocomplete - Default functionality</title>
      <link rel = "stylesheet" 
         href = "//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
      <script type = "text/javascript" 
         src = "https://www.tutorialspoint.com/jquery/jquery-3.6.0.js">
      <script type = "text/javascript" 
         src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
         $(function() {
            var availableTags = [
            $( "#tags" ).autocomplete({
               source: availableTags

      <div class = "ui-widget">
         <label for = "tags">Tags: </label>
         <input id = "tags">

This will produce following result −

Kickstart Your Career

Get certified by completing the course

Get Started