Following snippet performs an asynchronous HTTP (Ajax) request using JQuery

HTML Code

<button id="submit">Ajax Request</button>
<div id="result"></div>

JQuery Code

$('#submit').click(function(){
$("#result").html("<i class='fa fa-spinner fa-spin'></i> <br/> Processing...");
$.ajax({
type: "POST",
url: "post-page.php",
data: {name:value,name:value},
success: function(msg){
$("#result").html(msg);
}
});
});

Note: Don’t forget to include Jquery library file