This article mainly introduces the smart tip Effect of js text box input content, which is very simple and practical. If you need it, you can refer to the example in this article to describe the smart prompt effect code of js text box input content. Share it with you for your reference. The details are as follows:
The running effect is as follows:
General idea:
1. Listen to text box events. The keyup event is used here. You can try the onchange event. However, the effect of the keyup event is better.
2. Access background data asynchronously based on the input content through ajax.
3. traverse the returned data and add the data to the display area.
4. Add some effects to each piece of data while adding the data. Click one of them to fill in the data in the text box, and the prompt will disappear.
5. The background data should be spliced into json format.
The Code is as follows:
Automatic prompt