Is there an easy way to enable or disable an IFrame to pull it out of Tab order?
Ive created a simple HTML page with multiple links that, when clicked, displays or hides the IFrame associated with the link and sets the SRC IFrame property to one of my Wordpress PressThis blogs. Thus, I can easily add a message to any of the blogs from one page.
Everything on this page works just fine, as expected, except for the behavior of the Tab key. All IFrames are initially hidden and do not have an SRC set (for example, <iframe src=""></iframe> ). The problem is that when I press Tab, instead of moving from link to link, it focuses on hidden (and empty) IFrames between links.
When the frame is displayed and loaded by the PressThis form, pressing Tab correctly moves through the form input fields (and everything else on the page) between the links. However, when the frame is hidden again, pressing Tab still goes through each field, so getting a link from a link from the keyboard is pretty bad.
Im trying to figure out a way to switch the IFrame, so that when it is hidden, pressing Tab skips it (it is removed from the tab order), and when it is displayed, pressing Tab moves between the form fields.
I looked around and couldn't find anything about disabling HTML elements directly (HTML elements do not seem to have a disabled property as part of the DOM, and there is no CSS style). The closest I could find are people who ask about disabling certain form fields.
Is there an easy way to do this?
Thanks.
source share