var msg_search = $('.input__control').serialize(); $.ajax({ type: 'POST', url: 'api.php', data: msg_search, success: function(data) { $('#block').html(data); } });