two objects same action?

two objects same action?

can i do something like this:
$("#msg_list a[@class='msg']"),$("#out_msg_list a[@class='msg']").click(function()


when X and Y are clocked do this....
how can i do it?