Click here to Skip to main content
15,303,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
            $("#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>';
                // start ajax code
                    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>';
                        // when chat goes down the scroll bar automatically comes to the bottom

What I have tried:

<pre lang="Javascript">$("#send-btn").("click", function(){
Updated 11-Dec-21 9:23am

1 solution

Use the eventcode and either keyup or keydown
e.g. event.keyCode === 13

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900