Question


Let’s the following is our input type, wherein the user will search −

Now, use hide() and show() to display only relevant search and hide rest. For example, on typing “Ja”, related keywords like “Java” and “JavaScript” should be visible because it begins with “Ja”.

Example

 Live Demo






Document










To run the above program, save the file name “anyName.html(index.html)” and right click on the file. Select the option “Open with Live Server” in VS Code editor.

Output

This will produce the following output −

Now, I am entering the only Java and getting the search result. The screenshot is as follows −

Look at the above snapshot, remaining list of items are hiding.

raja
Published on 10-Sep-2020 07:24:31

Not affiliated with Tutorialspoint