How Can I Use keyup Method In JQuery With Examples

admin_img Posted By Bajarangi soft , Posted On 16-10-2020

In Jquery The keyup() method is sent to an element when the user releases a key on the keyboard. It is an inbuilt function of jQuery.So Today we discuss about this keyup() method

How Can I Use keyup Method In JQuery With Examples

Step 1:Create index.html file and implement below code.
 

Enter your name: <input type="text">

<h2 id="message"></h2>

Step 2:Implement jQuery to Keyup() methods.
 
<script>
    $(document).ready(function(){
        $("input").keydown(function(){
            var data=$("input").val();
            $("#message").html(data);
        });
    });
</script>


Complete Code For Using Keyup() Method In JQuery 
 
<!DOCTYPE html>
<html>
<head>
    <title>How Can I Use keyup Method In JQuery With Examples</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<style>
    body {
        background: black;
    }
</style>
<body>
<div class="container">
    <br><br><br><br>
    <div class="text-center">
    <h1 id="color" style="color: White;">Use keyup Method In JQuery </h1>
    </div>
    <br>
    <div class="well">
        Enter your name: <input type="text">
        <h2 id="message"></h2>
    </div>
</div>
</body>
</html>
<script>
    $(document).ready(function(){
        $("input").keydown(function(){
            var data=$("input").val();
            $("#message").html(data);
        });
    });
</script>

 

Related Post