<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<p>Enter your name and hit Process Button.</p>
<input id="ajax-val" type="name" placeholder="your name please">
<button id="ajax-btn">Process</button>
<p id="point"></p>
<script>
$("#ajax-btn").click(function(){
$("#point").text("Waiting for server response...");
$.post("post-ajax",{
name:$("#ajax-val").val(),
},function(res){
$("#point").text(res.data);
});
});
</script> </body>
</html>