Live Search Using Flask And jQuery Last Updated : 09 Apr, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will do a live search in Flask using Jquery. Live search means that whenever a user type any letter in the input box then all the words containing that letter will be shown. Installation This module does not come in-built with Python. To install it type the below command in the terminal. pip install flask After installing the flask create a new directory for the project. Inside that create a new file and name that app.py. Python3 from flask import Flask,render_template app = Flask(__name__) @app.route("/") def home(): return render_template("index.html") if __name__ == "__main__": app.run(debug=True) Inside the project create new directory templates and inside that create a new file index.html. This file contains the HTML code for user input where user will input the desired text and the output will be shown. The Jquery will search for the all the strings containing the matching character(s) typed by the user. Index.HTML HTML <!DOCTYPE html> <html> <head> <title>GFG</title> </head> <body> <input type="text" class="live-search-box" placeholder="search here" /> <ul class="live-search-list" type="None"> <li>C++</li> <li>c</li> <li>Python</li> <li>Java</li> <li>Javascript</li> <li>Golang</li> <li>R</li> <li>Ruby</li> <li>Scala</li> <li>C#</li> <li>PHP</li> <li>Fortran</li> <li>Dart</li> </ul> <script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script> <script type="text/javascript"> jQuery(document).ready(function($){ $('.live-search-list li').each(function(){ $(this).attr('data-search-term', $(this).text().toLowerCase()); }); $('.live-search-box').on('keyup', function(){ var searchTerm = $(this).val().toLowerCase(); $('.live-search-list li').each(function(){ if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) { $(this).show(); } else { $(this).hide(); } }); }); }); </script> </body> </html> To run this app open cmd or terminal in the same directory and type the below command. python app.py Output: Comment More infoAdvertise with us Next Article Live Search Using Flask And jQuery V vivekpisal12345 Follow Improve Article Tags : Python JQuery Python Flask Practice Tags : python Similar Reads Using JWT for user authentication in Flask JWT (JSON Web Token) is a compact, secure, and self-contained token used for securely transmitting information between parties. It is often used for authentication and authorization in web applications. A JWT consists of three parts:Header - Contains metadata (e.g., algorithm used for signing).Paylo 6 min read Google Pie Chart using Flask In this article, we will learn how to show data on a Google line chart using Python Flask. Python Flask is a popular web framework that allows us to create web applications in Python. Firstly, we will install Flask using the following command: pip install FlaskWhat is Google Line Chart Google line c 2 min read Single Page Portfolio using Flask In this article, weâll discuss how to create a single-page portfolio webpage using the Flask framework. This project demonstrates how to build an impressive portfolio to showcase your skills and experience to HR professionals, colleagues, or potential employers.Key features of this portfolio are-Dow 7 min read Flask NEWS Application Using Newsapi In this article, we will create a News Web Application using Flask and NewsAPI. The web page will display top headlines and a search bar where the user can enter a query, after processing the query, the webpage will display all relevant articles (up to a max of 100 headlines). We will create a simpl 7 min read Retrieving HTML Form data using Flask Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks. Read th 3 min read Like