<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <style> </style> </head> <body> <div id="result">This is a div container</div> <input type="button" id="post" value="post"> <script> $(function(){ $("#post").click(function() { $.post({ url: "test.php", dataType: "html", data: "user=tony&pwd=123", success: function(data) { $("#result").html(data); } }); }); }); </script> </body> </html>