Home > Web Front-end > JS Tutorial > body text

Detailed explanation of fuzzy prompt function of javascript input input box

巴扎黑
Release: 2018-05-15 14:36:42
Original
2571 people have browsed it

This article mainly introduces the relevant information about the implementation of the fuzzy prompt function of the javascript input input box. I hope it can help everyone through instinct. Friends in need can refer to the following

javascript input input box fuzzy prompt The implementation of the function

mainly uses the jQuery.autocomplete function. You can use this function after defining an array, which is very convenient.

<!doctype html>
<html>
<head>
 <meta charset="utf-8">
 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="external nofollow" >
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
 <script>
 $(function() {
  var availableTags = [
   "James",
   "Kobe",
   "Jordan"
  ];
  $( "#tags" ).autocomplete({
   source: availableTags
  });
 });
 </script>
</head>
<body>

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

</body>
Copy after login

Effect:

The above is the detailed content of Detailed explanation of fuzzy prompt function of javascript input input box. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template