IF id exists, hide other id's

IF id exists, hide other id's

looking for a bit of help here...I seem to be running in circles right now.

I am trying to write a script that will search the page for a certain ID...if said ID exists, then I want to hide a few other IDs.  this is what I have so far.

  1. <script type="text/javascript">
  2.     $(document).ready(function(){
  3.         if($("#articleGatingWrapper")) {
  4.             $("#lxTdivRating").hide();
  5.             $("#commentWrapper").hide();
  6.             $(".bottomArticleTools").hide();
  7.             $("p.addComment").hide();
  8.         });
  9.     });   
  10. </script>

thank you in advance for any help.
-Jeff