$(selector1, selector2).click(function(){})
http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN
e.g. $('td, th').click(function(){alert("clicked table cell");});
Colin

On Jul 2, 6:09 am, Alexandru Adrian Dinulescu <alex.d.a...@gmail.com>
wrote:
> Hello.
>
> I am trying to do something like this
> $(element1 || element2).click(function(){})
>
> unfortunately this does not work, both element1 and element2 work
> independently but not together and i have no clue how to get them to work
> together.
>
> Basically what i need that either when element1 is clicked, OR element2 is
> clicked, do identical thing.
>
> I know this is a very simple issue, but i havent learned Javascript at all,
> i've started with jQuery.
>
> Thank you

Reply via email to