You can use jQuery AJAX to autocomplete data on the single or multiple elements when the user search or select value from an element.
It is a better way to allow the users to easily search for data in existing records and get required information e.g. get student details by their id, product details, etc.
In the demonstration, I am using jQuery UI to display a suggestion list and fetch details using PHP from the MySQL database table when a value from the suggestion list gets selected.