JSFiddle - React, Tailwind, and code Playground

by alula

HTML

<select id='dropdownlist' name='dropdownlist'>
</select>

JavaScript

$('#btn').click({
   e.preventDefault();
        $.ajax({
        type: "POST",
        url: "<? echo base_url(); ?>/select/selctlist",//the search method
        data: {id: '1'},//the catogry id, search is made by this id
        success: function(msg){//result comes successfully 
            $($.parseJSON(msg)).map(function (){
                return $('<option>').val(this.id).text(this.label);
            }).appendTo('#dropdownlist');
        }
    })
})