php - How to add a jQuery Listener for 2 events? -


i have event in table if clicked function fires, want same function fire if item on dropdown select option selected.

my working code table td if clicked is:

$('td[id^="tblcell"]').click(function() { ... ... ... }); 

how can add code first line same function executues if select changed?

something like:

$('td[id^="tblcell"]').click(function() or ('select[id^="selectlist"]').onchange(function() { 

but doesn't work due syntax error... correct way code this? (if possible).

i using php , latest jquery.

thanks

simply put code function , call in 2 seperate handlers.

$('td[id^="tblcell"]').click(dostuff); $('select[id^="selectlist"]').on('change', dostuff);  function dostuff(event) {     // code } 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -