I want to focus back on the main page from an iFrame that is loaded as an element on the page. I am trying to make a toggle focus using CTRL to go between the two. I am using javascript to navigate the iFrame to different pages.

Once the iFrame has focus, I can't get it to focus on the parent document. Any ideas?

Per the discussion in this site you might be able to achieve what you're looking for with one of the following:

top.focus()
parent.focus()

Apparently, however, this will not work in Internet Explorer.

It appears that there are a number of items within the iframe framework that do not work properly with IE however. Unless your target audience is guaranteed not to be using IE for their browsing I would possibly look into alternatives to the iframe construct.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.