0

I have to elements #addimage and #addimage_imgtab that both need to be handled by the same function when clicked. I thought the following code should work, but it isn't, what am I doing wrong?

$('#addimage #addimage_imgtab').click(function(e){ .... });
1
  • 1
    The space is the descendant selector. You are looking for an element with ID addimage_imgtab inside an element with ID addimage. Commented Jun 22, 2013 at 9:18

1 Answer 1

2

You forget a comma:

$('#addimage, #addimage_imgtab').click(function(e){ .... });
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.