How to implement a simple search box automatic prompt function? This article mainly introduces the simple retrieval automatic completion prompt function implemented by php+mysql+jquery, involving the operation skills related to ajax database query and event dynamic response based on jQuery. Friends in need can refer to it. I hope to be helpful.
The details are as follows:
I have read some content about automatic completion prompts during this period and found that most of the implementation processes are very complicated. I thought this should be a relatively simple function, so I tried it myself. The idea is very conventional. It should be noted that there are no keyboard events bound to the prompt content, and only mouse operations can be used.
html+jQuery content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
stuSearch.php code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Rendering
When inputting:
After clicking on an item:
Related recommendations:
Detailed explanation of PHP Implement Sudoku solving
Detailed explanation on how to dynamically transfer data to highcharts through php
Detailed explanation How to generate time-sensitive ciphertext with PHP
The above is the detailed content of Detailed explanation of how to implement a simple search box automatic prompt function in PHP. For more information, please follow other related articles on the PHP Chinese website!