Is there any method to have the same coding for the click function of two different id elements in one click function?
For example,I have two link elements with ids, myFormsTabSubmitted and formStatusSubmitted. Both the link is of same functionality. When I click both these links, the same div element("submitted") is showed,and other divs are hidden.
So instead of writing two click functions, one for myFormsTabSubmitted and another for formStatusSubmitted, can I have one click function for both? Like
$('#myFormsTabSubmitted #formStatusSubmitted').click(function(){
$('#allMyForms').hide();
$('#draftedMyForms').hide();
$('#submittedMyForms').show();
$('#myFormsTab').find(".selected").removeClass();
$('#myFormsTabSubmitted').addClass("selected");
});