jQuery keyup()

The jQuery keyup() method is used to attach a function to run when a keyup event occurs i.e. when a keyboard button is released after pressing. Syntax: To trigger the keyup event for selected elements. $(selector).keyup() To add a function to the keyup event. $(selector).keyup(function) Function: It is an optional parameter. The function parameter specifies … Read more

jQuery keypress()

The jQuery keypress() method is used to attach a function to run when a keypress event occurs i.e., when a keyboard button is pressed down. Syntax: To trigger the keypress event for selected elements. $(selector).keypress() To add a function to the keypress event. $(selector).keypress(function) Function: It is an optional parameter. The function parameter specifies the … Read more

jQuery keydown()

The jQuery keydown() method is used to attach a function to run when a keydown event occurs i.e., when a key is pressed on the keyboard. Syntax: To trigger the keydown event for selected elements. $(selector).keydown() To add a function to the keydown event. $(selector).keydown(function) Function: It is an optional parameter. The function parameter specifies … Read more

jQuery submit()

The jQuery submit() method is used to attach a function to run when a submit event occurs i.e., when the user attempts to submit a form. This method is limited to <form> element. Syntax: To trigger the submit event for selected elements. $(selector).submit() To add a function to the submit event. $(selector).submit(function) Function: It is … Read more

jQuery change()

The jQuery change() method is used to attach a function to run when a change event occurs i.e, when the value of an element is changed. This method is limited for form fields only, for input elements, textarea boxes and select elements. The change event is fired immediately in case of select boxes, checkboxes, and … Read more

jQuery focus()

The jQuery focus event is implicitly used for a limited set of elements like input, select, a href, etc. As the name suggests, this event occurs when an element gains focus. Syntax: To trigger the focus event for selected elements. $(selector).focus() To add a function to the focus event. $(selector).focus(function) Function: It is an optional … Read more

jQuery blur()

The jQuery blur() event triggers the blur (element loses focus) event. Syntax: To trigger the blur event. $(selector).blur() To add a function to the blur event. $(selector).blur(function) Function: It is an optional parameter that is used to specify the function to run after the event occurs. Example1: <!DOCTYPE html> <html> head> <script src=”https://code.jquery.com/jquery-1.10.2.js”></script> <script> $(document).ready(function(){ … Read more

jQuery bind()

The jQuery bind() event attaches one or more event handlers of the selected elements and executes a specified function when the event occurs. Syntax: $(selector).bind(event,data,function,map) Event: It is a compulsory parameter as it specifies the events to attach. Data: It is an optional parameter that is used to specify any additional data. Function: It is … Read more

jQuery click()

The jQuery click () method is executed once the click event occurs. Syntax: To trigger the click event for the selected elements. $(selector).click() To attach a function to the click event. Example1: <!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> <script> $(document).ready(function(){ $(“h1,h2”).click(function(){ $(this).hide(); }); }); </script> </head> <body> <h1>Click me. I am a ghost.</h1> <h2>Me too.</h2> … Read more