<pre><script> $(document).ready(function(){ $("#send-btn").on("click", function(){ $value = $("#data").val(); $msg = '<div class="user-inbox inbox"><div class="icon"></div><div class="msg-header"><p>'+ $value +'</p></div></div>'; $(".form").append($msg); $("#data").val(''); // start ajax code $.ajax({ url: 'message.php', type: 'POST', data: 'text='+$value, success: function(result){ $replay = '<div class="bot-inbox inbox"><div class="icon">^__i class="fas fa-robot fa-lg"></div><div class="msg-header"><p>'+ result +'</p></div></div>'; $(".form").append($replay); // when chat goes down the scroll bar automatically comes to the bottom $(".form").scrollTop($(".form")[0].scrollHeight); } }); }); }); </script>
<pre lang="Javascript">$("#send-btn").("click", function(){
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)