This is the piece of jQuery I wrote,
$('#editUser').click(function() {
if ($(".selectedTR")[0]) {
if($('.form-actions').is(':visible')) {
$('.form-actions').slideUp('slow',function() {
$('.form-actions > h3').text("Edit");
}).css('display', 'none');
}
$('.form-actions').css('display', 'block').slideDown('slow');
} else {
alert("Please select a user");
}
});
How can I remove the duplicated selectors?
$('.form-actions')
and use it.