So I have two jquery functions that bassically do the same, but on 2 seperate containers. Is there a way to combine these two functions.
$('#autobid-list .auction-button').click(
function(){
if($(this).attr('summary') == 'autobid-button'){
$(this).parents('li').addClass('none');
}else if($(this).attr('summary') == 'watchlist-button'){
if($(this).hasClass('watchlist-1')){
$(this).parents('li').clone().appendTo('#watchlist-list');
}else{
$('#watchlist-list .auction-' + $(this).parents('table').attr('summary')).parents('li').addClass('none');
}
}
}
);
$('#watchlist-list .auction-button').click(
function(){
if($(this).attr('summary') == 'watchlist-button'){
$(this).parents('li').addClass('none');
}else if($(this).attr('summary') == 'autobid-button'){
if($(this).hasClass('autobid-1')){
$(this).parents('li').clone().appendTo('#autobid-list');
}else{
$('#autobid-list .auction-' + $(this).parents('table').attr('summary')).parents('li').addClass('none');
}
}
}
);
These two do bassically the same, the only change is the input of either 'autobid' or 'watchlist'