Wednesday, 15 April 2015

Adding same click event handler to 2 different elements -


I need both the elements #addimage and #addimage_imgtab On click should be managed by the same function. I thought the following code should work, but it is not, what am I doing?

  $ ('# addimage #addimage_imgtab'). Click (function (e) {....});    

You forget the comma:

  $ ('#addimage, #addimage_imgtab'). Click (function (e) {....});    

No comments:

Post a Comment