I have a example html menu:
A
If I understand your question correctly, try using this:
$('.menu_button').click(function() { if ( $(this).attr('id') == "m1" ) .... })
Btw: In this case, a switch .. case would be far more appropriate!
switch .. case