Results 1 to 3 of 3

Thread: Reference Anchor in other frame

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    45

    Reference Anchor in other frame

    This should be simple but I can't find the syntax. I have an achor in an html page :-

    <A name=Test1 href="Background.html" target="main">Background</A>

    I want to change the color of the font from a page in a different frame (oh no Frames!) using a Javascript command such as :-

    parent.leftbar.Test1.style.color='#000080'; //Leftbar being the name of the other frame.

    Anyway, all I get is an error about a null object so I guess this isn't the way to reference it.
    Last edited by Uncle Bob; Nov 24th, 2006 at 10:04 AM. Reason: spelling error

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Reference Anchor is other frame

    Try

    window.frames['leftbar'].document.links['Test1'].style.color = '#000080';

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    45

    Re: Reference Anchor is other frame

    "Error: window.frames['leftbar'].document is null or not an object"

    Been getting this all day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width