iframes, parent and child documents

iframes, parent and child documents

Hello:

I'm putting some finishing touches on my website. One is to insert links from one part of the page/site to another part. For example:

At this point I'm trying to get a button on a parent document to add and remove classes of an element in a child iframe. I've successfully moved focus to the iframe, but can not change classes of the child element. Following is my syntax:

  1.     $('.ref_bttn').click(function()
  2.     {
  3.         $('#client_content').hide();
  4.         $('#ref_content').show();
  5.         $('#client_tab').removeClass("selected");
  6.         $('#ref_tab').addClass("selected");
  7.        
  8.         // commands work great until this point. The following elements - by id - are in the child iframe. Their 'selected' classes are NOT changing.
  9.         $('#PIAW_lttr',ifrm.document).removeClass("selected");
  10.         $('#Grad_lttr',ifrm.document).addClass("selected");
  11.     });
What am I doing wrong with my syntax???

Thanks Much - Pavilion