1.

What Is Jquery Syntax For Event Methods And Give An Example?

Answer»

Most DOM events have an EQUIVALENT jQuery method.

Example:

STEP 1: To assign a click event to all paragraphs on a page, you can do this: $("p").click();

Step 2: The next step is to define what should happen when the event fires. You must PASS a function to the event:

$("p").click(function(){ // action goes here!! });

Most DOM events have an equivalent jQuery method.

Example:

Step 1: To assign a click event to all paragraphs on a page, you can do this: $("p").click();

Step 2: The next step is to define what should happen when the event fires. You must pass a function to the event:

$("p").click(function(){ // action goes here!! });



Discussion

No Comment Found