Here we are going to explain what is keydown() event or how to use keydown() event or why to use keydown() event with example.


In Jquery keydown event occurs when a keyboard key is pressed down, the keydown() event is occurred and once the keydown() event is occurred, it executes the function associated with keydown() method to run.

  • Syntax:

Trigger the keydown event for the selected elements:



  • Example of jQuery keydown() event

Let's see an example to of jQuery keydown() event.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AngularJS.aspx.cs"
Inherits="AngularJSTutorials.AngularJS" %>
<!DOCTYPE html>
<html xmlns="">
<head runat="server">
    <script src="Scripts/jquery-1.8.2.min.js"></script>   
  <script type="text/javascript">     
      $(document).ready(function () {
          $("input").keydown(function () {
              $("#content").css("color", "red");
    <form id="form1" runat="server">
     Write something: <input type="text"> 
    <p id="content" style="margin-top:10px; width: 300px; height: 88px; color:#fff;">            


Use jQuery keydown() Method

I hope it will help to you.

 Let's check live example

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like