Please tell me, is there a js script that looks up the value table and displays them:
<script> $(document).ready( function() { $('#category').keyup(function(){ if($(this).val().length > 0){ $.ajax({ type: "POST", url:"/autocomplete/auto_cat.php?id=<?=$_GET['id']?>", dataType: 'json', data: {'choose' : $(this).val()}, success: function(res){ console.log(res); var content = ''; $.each(res, function(i, item){ content += "<div class='ott_g' data-id='"+res[i].id_c_p+"'>"+res[i].name_c_p+"</div>"; $("#pk").css({"margin-top": "29px", "background": "#fff", "position": "absolute", "margin-left": "138px", "width": "170px", "border": "2px dashed #e0e0e0", "text-align": "left", "padding": "5px", "font-size": "15px"}); }); $('.aut_cont').html(''); $('.aut_cont').append(content); } }); }else{ $('.aut_cont').html(''); } }); $('body').on( 'click', '.ott_g', function(){ var id = $(this).attr('data-id'); $('.user_id').val(id); var txt = $(this).text(); $('#category').val(txt); $('.aut_cont').html(''); }); } ); </script> The bottom line is when the content is displayed, we use the style:
$("#pk").css({"margin-top": "29px", "background": "#fff", "position": "absolute", "margin-left": "138px", "width": "170px", "border": "2px dashed #e0e0e0", "text-align": "left", "padding": "5px", "font-size": "15px"}); How to remove this style after we chose a value? Now this is what happens: 
After selecting the value:

addClassandremoveClass. - Stepan Kasyanenko