header.js ------------ Fade main content to white/grey when search bar has focus fade out: $('.wh_content_area').fadeTo(500, 0.2); fade back in $('.wh_content_area').fadeTo(500, 1); if ($('#textToSearch.activeElement')){ $('.wh_content_area').fadeTo(500, 0.2); $('.wh_content_area').find('*').prop('disabled', true); } jQuery (>= 1.7): The following selects all descendant elements and disables them: $("#dcacl").find("*").prop("disabled", true); $("#dcacl").find("*").prop("disabled", false);