This is the piece of jQuery I wrote,
$(\'#editUser\').click(function() {
if ($(\".selectedTR\")[0]) {
if($(\'.form-actions\').is(\':visible\')) {
You can cache the selector by putting it in a variable. Try this:
$('#editUser').click(function() {
if ($(".selectedTR").length) {
var $formActions = $('.form-actions');
if ($formActions.is(':visible')) {
$formActions.slideUp('slow', function() {
$formActions.children('h3').text("Edit");
}).css('display', 'none');
}
$formActions.css('display', 'block').slideDown('slow');
} else {
alert("Please select a user");
}
});