0

In my page I define a group of the DOM elements with the same click event (some of them are loaded dynamically)

$('div.main-container a.class1, a.class2').live('click',function(){ ... });

the element a.class1 and a.class2 has their own click functions, and in that scenario, my group click function does not fire. So, is it possible to bind two different click functions to the one DOM element ?

1
  • Why don't you just put two functions in the one click event? Commented Sep 10, 2012 at 22:27

1 Answer 1

1

Combine all the relevant handlers you need in a function and bind all the click events to something like this:

function ()
{
    handler1();
    handler2();
    handler3();
}

Cheers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.